-
Notifications
You must be signed in to change notification settings - Fork 124
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
How send POST request with form data? #56
Comments
So I'm not sure exactly what the issue you're having is, I apologize in advance if I'm misunderstanding. When you run this
You'll notice that you get back the following data from {
"args": {},
"data": "{\"foo\":\"bar\"}",
"files": {},
"form": {},
"headers": {
"Accept": "*/*",
"Content-Length": "13",
"Content-Type": "application/json",
"Host": "httpbin.org",
"User-Agent": "curl/7.37.1"
},
"json": {
"foo": "bar"
},
"url": "http://httpbin.org/post"
} When you make the same request using
Here's the
which does appear to be the same. I'm not sure what the I'm going to close this issue for now, feel free to close if I misunderstood and you're still having issues. |
Having a same problem. The issue is how to submit data encoded as If we follow example from README and send like this: post 'http://httpbin.org/post', {}, {params: {foo: 'bar'}} Result will be: {
"args": {
"foo": "bar"
},
"data": "{}",
"files": {},
"form": {},
"headers": {
"Accept": "*/*; q=0.5, application/xml",
"Accept-Encoding": "gzip, deflate",
"Content-Length": "2",
"Content-Type": "application/json",
"Host": "httpbin.org",
"User-Agent": "Ruby"
},
"json": {},
"origin": "202.62.16.254",
"url": "http://httpbin.org/post?foo=bar"
} As I see option After going through source code I found solution to send form data in body: post('http://httpbin.org/post', {foo: 'bar'}.to_query, 'Content-Type' => 'application/x-www-form-urlencoded') I think there should be a proper documentation for DSL methods with information about attributes and possible types |
I have the same problem. Is there a fix in sight, or do we have to use @Paxa's workaround for the time being? |
@brooklynDev @Paxa Were you ever able to come to a consensus as to whether this is an issue? I'm running into the same thing - unable to figure out how to encode the body as application/x-www-form-urlencoded |
Hello. I want send POST request with form data.
All my requests don't send request with
:form
.Why?
Soooooory for my bad english. :(
The text was updated successfully, but these errors were encountered: