Skip to content
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

Unable to receive POST data for Content-Type: application/x-www-form-urlencoded #92

Closed
cizexzza opened this issue Mar 8, 2017 · 11 comments

Comments

@cizexzza
Copy link

cizexzza commented Mar 8, 2017

I send the POST sample is fine for any Content-Type except "application/x-www-form-urlencoded".

send:
curl -X POST localhost:19092/topics/foo/messages?sync -H 'Content-Type:text/plain' -d 'blah blah blah'

Response:
{
"partition": 0,
"offset": 41
}

send:
curl -X POST localhost:19092/topics/foo/messages?sync -H 'Content-Type:application/x-www-form-urlencoded' -d 'blah blah blah'

Response:
{
"error": "Message size does not match Content-Length: expected=14, actual=0"
}

How do i receive POST for Content-Type is application/x-www-form-urlencoded?

@horkhe
Copy link
Member

horkhe commented Mar 8, 2017

@cizexzza at the moment only text/plain with utf-8 encoding is supported. Why do you need application/x-www-form-urlencoded if text/plain works fine for you?

@cizexzza
Copy link
Author

cizexzza commented Mar 8, 2017

oh, I can not change the data source and the data Content-Type is application/x-www-form-urlencoded .

@horkhe
Copy link
Member

horkhe commented Mar 8, 2017

@cizexzza why you cannot change the content-type? How do you make requests? I mean what programming language+framework are you using?

@cizexzza
Copy link
Author

cizexzza commented Mar 8, 2017

i can change my programming language requests content-type , but i can not change data from other machine equipment , the equipment send data Content-Type is application/x-www-form-urlencoded.

@horkhe
Copy link
Member

horkhe commented Mar 8, 2017

@cizexzza I am just curious what "other machine equipment" you are using that it does not let you these change?

@cizexzza
Copy link
Author

cizexzza commented Mar 9, 2017

ya. i just can collect it data.

@horkhe
Copy link
Member

horkhe commented Mar 9, 2017

@cizexzza sorry, I do not understand you.

@horkhe
Copy link
Member

horkhe commented Mar 15, 2017

@cizexzza still interested in this? I can add support for application/x-www-form-urlencode.

@asitm9
Copy link

asitm9 commented May 28, 2017

@horkhe I would be more than happy to add this .

@horkhe
Copy link
Member

horkhe commented May 31, 2017

@asitm9 if you want to do that yourself, then please be my guest. By the way, we at Mailgun do not rely on HTTP interface anymore, we use gRPC internally and in fact recommend everybody to do the same.

@horkhe horkhe closed this as completed in 83599e4 Jun 17, 2017
horkhe added a commit that referenced this issue Jun 17, 2017
Add support for x-www-form-urlencoded (fixes #92)
@horkhe
Copy link
Member

horkhe commented Jun 17, 2017

@cizexzza it will become available in v0.13.1, but you can build Kafka-Pixy from sources right now. It should work like this:

curl -X POST localhost:19092/topics/foo/messages?sync -H 'Content-Type:application/x-www-form-urlencoded' -F 'msg=blah blah blah'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants