Powershell HTTPIE



我正在尝试POST以下内容,但一直收到错误:

"http:error:argument REQUEST_ITEM:"with"不是有效值">

http POST https://someurl.com fields:='{"example-api-identifier":"String with spaces"}' Token:randomnumbers

如何逃离这些空间?我想这就是问题所在吧?

我个人不知道powershell,但httpie应该可以使用空格,而不需要:=语法

$ http POST http://httpbin.org/post example-api-identifier="String with spaces"

产生

HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Connection: close
Content-Length: 413
Content-Type: application/json
Date: Sat, 01 Feb 2020 00:25:41 GMT
Server: gunicorn/19.9.0
{
"args": {},
"data": "{"example-api-identifier": "String with spaces"}",
"files": {},
"form": {},
"headers": {
"Accept": "application/json, */*",
"Accept-Encoding": "gzip, deflate",
"Connection": "keep-alive",
"Content-Length": "48",
"Content-Type": "application/json",
"Host": "httpbin.org",
"User-Agent": "HTTPie/1.0.0"
},
"json": {
"example-api-identifier": "String with spaces"
},
"origin": "127.0.0.1",
"url": "http://httpbin.org/post"
}

相关内容

  • 没有找到相关文章

最新更新