mailgun/kafka-pixy

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

Closed this issue · 11 comments

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?

@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?

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

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

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.

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

ya. i just can collect it data.

@cizexzza sorry, I do not understand you.

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

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

@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.

@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'