Httpie auth plugin issues POST Request FORMAT

159 Views Asked by At

POST JSON body doesnt work with these plugins and have opened issues. Same POST Syntax I have successfully used with oauth, ntlm etc

  1. HAWK echo '{"hello": "world"}' | http POST http://localhost:8080/ --auth-type=hawk --auth 'username:password' Error: http: error: TypeError: a bytes-like object is required, not 'str' Opened issue: https://github.com/mozilla-services/requests-hawk/issues/26

  2. HMAC 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 Opened Issue: https://github.com/guardian/httpie-hmac-auth/issues/5

  3. HTTPIE echo '{"hello": "world"}' | http POST http://localhost:8080/ --auth-type=httpsig --auth 'username:password' http: error: AttributeError: 'bytes' object has no attribute 'encode' Opened Issue: https://github.com/east36/httpie-http-signatures/issues/5

1

There are 1 best solutions below

0
On

Those issues should be fixed with:

  1. requests-hawk: PR #32
  2. httpie-http-signatures: PR #6
  3. httpie-hmac-auth: PR #6