You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 12, 2022. It is now read-only.
What is the correct syntax to send post with JSON?
When I send POST with body
echo '{"hello": "world"}' | http POST http://localhost:8080/ --auth-type=hmac --auth 'username:password'
http: error: TypeError: sequence item 1: expected str instance, bytes found
The above syntax works fine with other authentication plugins)
When I SEND POST without body it complains that body is missing
http POST http://localhost:8080/ --auth-type=hmac --auth 'username:password'
GET WORKS FINE
http GET http://localhost:8080/ --auth-type=hmac --auth='client:secret'
HTTP/1.1 200
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: application/json;charset=UTF-8
Date: Fri, 10 Jul 2020 10:44:40 GMT
Expires: 0
Pragma: no-cache
Transfer-Encoding: chunked
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
What is the correct syntax to send post with JSON?
When I send POST with body
echo '{"hello": "world"}' | http POST http://localhost:8080/ --auth-type=hmac --auth 'username:password'
http: error: TypeError: sequence item 1: expected str instance, bytes found
The above syntax works fine with other authentication plugins)
When I SEND POST without body it complains that body is missing
http POST http://localhost:8080/ --auth-type=hmac --auth 'username:password'
GET WORKS FINE
http GET http://localhost:8080/ --auth-type=hmac --auth='client:secret'
HTTP/1.1 200
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: application/json;charset=UTF-8
Date: Fri, 10 Jul 2020 10:44:40 GMT
Expires: 0
Pragma: no-cache
Transfer-Encoding: chunked
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
{
"auth_details": "HMAC client:YsQoZJGbtb3ksxuMdayD0vySl2wTx26ahRtLCr/+4pw=",
"body_info": null,
"host_info": "localhost:8080",
"id": 5,
"method_info": "GET",
"path_info": "/",
"protocol_info": "http",
"query_params": null
}
The text was updated successfully, but these errors were encountered: