-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
application/x-www-form-urlencoded support. #960
Comments
@Miladrzh thanks for your bug report. We do test this in our integration tests, so it should be working: https://github.com/grpc-ecosystem/grpc-gateway/blob/master/examples/integration/integration_test.go#L1502. The main difference is that our integration tests use a "GET" request for this: |
Looking at the code, I think the problem is that you've defined it as POST actually. Why aren't you using JSON if you're using a post request? |
Take a look at the source: Line 249 in 0d29f14
application/x-www-form-urlencoded you have to define a custom marshaller.
|
Unfortunatelly, i can't change the request cause it comes from outside resources which that protocol is like that. I know it needs a custom marshaller but does grpc-gateway have plan to implement this marshaller? As many framework like django recognize post in application/x-www-form-urlencoded format. |
You can implement your own Marshaler and hand it to |
If you implement a form marshaler and would like to contribute it back to us, you're welcome to do so. I will close this issue as I think there's a clear path forward. Please let me know if you need more help. |
Hello to all grpc-gateway community.
I have a api call which its request is post and data come in application/x-www-form-urlencoded format
for example:
foo=bar&something=somethingelse
But grpc-gateway cant serialize it into my request.
i use proto3 and my request is like
I try to serialize it like strings or like bytes but none of them work correct even in bytes.
i get this error when i call my api with this body
foo=bar&something=somethingelse
"invalid character 'f' looking for beginning of value"
Can anybody help me what should i do?
The text was updated successfully, but these errors were encountered: