0

Is there equivalent way to make this cURL call with HTTPie?

curl -k -d '<?xml version="1.0" encoding="UTF-8"?><methodCall><methodName>wp.getUsersBlogs</methodName><params><param><value>user</value></param><param><value>pass</value></param></params></methodCall>' https://crmpicco.co.uk/xmlrpc.php

I have tried the following without any success:

http --pretty=all --verify=no POST https://crmpicco.co.uk/xmlrpc.php data="<?xml version="1.0" encoding="UTF-8"?><methodCall><methodName>wp.getUsersBlogs</methodName><params><param><value>admin</value></param><param><value>pass</value></param></params></methodCall>"

I prefer using HTTPie, but in this instance i've had to fallback to cURL.

4

1 回答 1

4

使用 HTTPie,您stdin可以传递原始请求正文数据,例如:

PAYLOAD='<?xml version="1.0" encoding="UTF-8"?><methodCall><methodName>wp.getUsersBlogs</methodName><params><param><value>admin</value></param><param><value>pass</value></param></params></methodCall>'

echo "$PAYLOAD" | http --verify=no https://crmpicco.co.uk/xmlrpc.php 

文档:https ://httpie.org/doc#redirected-input

于 2019-03-11T07:32:57.680 回答