Editing
Using curl to test POST data
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Following redirects == <syntaxhighlight lang="bash"> $ curl -L -X POST -d "foo=bar&biz=bash" http://dev-server.com </syntaxhighlight> * `-L` '''location''' Tells `curl` to reattempt the get if the server reports that the page is at a different location (`301` and `302` responses) * `-X POST` Explicitly use the POST method (as opposed to the `-d` option which implicitly uses POST.<ref>[http://man.cx/curl curl man page]</ref> (man.cx manual pages) This happens with Symfony, which sends a `301` response with its controllers.<ref>[http://stackoverflow.com/a/22654902 php curl post request to symfony2 app shows an empty ParameterBag] (Stackoverflow)</ref>,<ref>[http://www.recursion.org/2011/11/18/following-redirects-with-curl Following Redirects with Curl] (recursion.org blog)</ref> <p class="alert-warning">N.B. This did not work on the first attempt with Symfony. Not sure if it's not a solution, or if I was doing something wrong.</p>
Summary:
Please note that all contributions to Littledamien Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Littledamien Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information