-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
form data unicode post request not work #1224
Comments
What are you trying to achieve @nvcken ? Do you want a multipart encoded body or a urlencoded one? |
@simov |
Why are you passing wrong request.post('http://...', {
formData: {
my_field: 'something'
}
}, function (err, res, body) {}) That should work, also take a look at the docs https://github.com/request/request#multipartform-data-multipart-form-uploads |
ah, before set headers to options |
@simov I have question is it possible make it work with multipart/form-data (formData) too ? |
That depends on the service you use, unless it's your own server. |
@simov |
looks like this has been resolved? let us know if that's not the case. |
var options = {
url : 'http://example.com/abc',
method : 'POST',
headers : {
'content-type': 'application/x-www-form-urlencoded; charset=utf-8'
}
}
var r = request( options , function optionalCallback(err, httpResponse, body) { // ...
var form = r.form();
form.append('my_field', 'unicode character here');
After exec , the endpoint receive strange character value of "my_field"
What I am wrong?
The text was updated successfully, but these errors were encountered: