我试图发布以下内容,但一直有一个错误:
"http: error:参数REQUEST_ITEM:"with“不是有效值”
http POST https://someurl.com fields:='{\"example-api-identifier\":\"String with spaces\"}' Token:randomnumbers
我该如何逃离这些空间?我想这就是问题所在吧?
发布于 2020-02-01 00:28:55
我个人对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"
}https://stackoverflow.com/questions/53107894
复制相似问题