User Tools

Site Tools


curl:post_to_a_page

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
curl:post_to_a_page [2019/11/27 00:10] – removed petercurl:post_to_a_page [2020/09/25 13:03] (current) – created 192.168.1.1
Line 1: Line 1:
 +====== Curl - Post to a page ======
 +
 +To process a POST request using CURL. 
 +
 +The data will use the **application/x-www-form-urlencoded** encoding. 
 +
 +Lets say you have the following POST form in your page:
 +
 +<code html>
 +<form method="POST" action="process.php">
 +          <input type=text name="item">
 +          <input type=text name="category">
 +          <input type=submit name="submit" value="ok">
 +</form>
 +</code>
 +
 +You can use the following CURL command to POST the request.
 +
 +<code bash>
 +curl -d "item=bottle&category=consumer&submit=ok" www.example.com/process.php
 +</code>
  
curl/post_to_a_page.1574813430.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki