requestify
requestify copied to clipboard
JSON encoding breaks on post data with foreign characters
Are you using ascii instead of utf8 somewhere? Try sending a post request with a foreign char e.g. "ø" - json encoding breaks.
Hey, Sorry for the late answer, I was on-board.. Actually and only thing I'm using is UTF8 with standard JSON.stringify, and I just tried it and could not reproduce, can you give me an example?
Hi,
I'm also having this issue. I'm trying to send JSON that contains foreign characters and I'm getting:
{ [Error: socket hang up] code: 'ECONNRESET' }
Something as simple as this causes it to break for me:
requestify.post(serverURL, { test: 'ö' }).then(function(request) { ... });
and my web server says:
[Fri Nov 29 18:22:31 2013] 127.0.0.1:52214 Invalid request (Malformed HTTP request)
Any ideas?
Hey, Sorry for the late answer... I'm trying that with a simple node server and plays nicely... What web server do you use?
Hi. The web server was the native PHP 5.4 development server ($ php -S host:port
), using Laravel framework... I believe I solved this issue by switching to a different request module after all. Not sure why it was happening.
OK, can you please let me know what request module you've used after all?
I used mikael/request instead.
I also have this problem, sending a query to elasticsearch via requestify's POST causes errors.
E.G.
requestify.post(url, {"query": "à"})
Doing it with other http clients (including the above mentioned mikael/request) does not yield any problem.