-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong custom header value #84
Comments
Hi @fewensa thanks for reporting! I'm trying to reproduce this error and will keep you posted of any findings. Stay tuned! |
For a start, I have updated the documentation so it mentions |
@fewensa I can see that header values are being changed to arrays containing the actual value as their only entry. I believe this is done internally by the library we use for HTTP queries. I'll investigate some more and confirm where is this conversion happening. I would also love to know more about your specific use case so that we can prototype the best way to deal with this. |
@fewensa For what it's worth, you can simply add this at the end of the retrieval script to get rid of the extra brackets:
Here's the full execution trace:
|
Hi @aesedepece Thanks for your help, I think now don't care how to parse response, because this has no value, this data is the request data structure returned by httpbin.org.
As long as you still see an array here, it means that the request is wrong. Wrong header
Right header
I think so, I tried to investigate the code of witnet-requests-js. I didn't find where the http request was called.
|
I think there changed header value to array. then send data direct use sede_json::to_string, send raw json string to server. https://docs.rs/http-types/2.12.0/http_types/headers/struct.HeaderValues.html |
When i try to call post request with custom header follow docs
https://docs.witnet.io/smart-contracts/witnet-web-oracle/make-a-post-request
got this response
The reason is some where changed header value
The head value changed to
["Header-Value"]
and["application/json"]
not raw value.The text was updated successfully, but these errors were encountered: