Answer the question
In order to leave comments, you need to log in
How to correctly form a POST request through curl?
Good afternoon, ladies and gentlemen. Such a task: to check, you need to form a request in curl POST for the controller's create method.
The method accepts parameters:
params.require(:facebook_token).permit(:url, :login, :password, :proxies)
curl -d "facebook_token[url]=https:\//www.facebook.com\/dialog\/oauth?client_id=123456&redirec_uri=blablabla" -d "facebook_token[login][email protected]" -d "facebook_token[password]=54321" -d "facebook_token[proxies]=asdfghj" http://localhost:3000/facebook_tokens.json
&redirec_uri=blablabla
https:\//www.facebook.com\/dialog\/oauth?client_id=123456.
Answer the question
In order to leave comments, you need to log in
Two strings can be passed to curl with the d key:
respectively, your string
"facebook_token[url]=https:\//www.facebook.com\/dialog\/oauth?client_id=123456&redirec_uri=blablabla"
parsed into two parameters ( facebook_token[url]
and redirec_uri
) facebook_token[url]
and facebook_token[client_id]
.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question