GET:
with JSON:
curl -i -H "Accept: application/json" -H "Content-Type: application/json" http://hostname/resource
with XML:
curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET http://hostname/resource
POST:
For posting data:
curl --data "param1=value1¶m2=value2" http://hostname/resource
For file upload:
curl --form "[email protected]" http://hostname/resource
RESTful HTTP Post:
curl -X POST -d @filename http://hostname/resource
For logging into a site (auth):
curl -d "username=admin&password=admin&submit=Login" --dump-header headers http://localhost/Login curl -L -b headers http://localhost/
Related Posts:
- Difference between `curl -I` and `curl -X HEAD`
- How do I POST JSON data with cURL?
- How do I POST JSON data with cURL?
- Is there a way to follow redirects with command line cURL?
- How can I set the request header for curl?
- How to display request headers with command line curl
- How to fix libeay32.dll was not found error
- cURL to show response headers after submiting a file
- wget/curl large file from google drive
- How do I POST JSON data with cURL?
- curl: (35) SSL connect error
- How do I make curl ignore the proxy?
- SSL CA cert (path? access rights?)
- How do I measure request and response times at once using cURL?
- cURL equivalent in Node.js?
- Curl Error 56 “Failure when receiving data from the peer” while sending .tar.gz File
- Run Rsync from Python [duplicate]
- wp_remote_get vs. file_get_contents vs. cURL?
- wp_remote_get – cURL error 28 – only on same domain
- cURL – How to send and fetch data in WordPress
- cURL RETURNTRANSFER function in wp_remote_post
- How to convert this cURL to wp_remote_*?
- How to send file by wp_remote_post?
- Download file using cURL into wp-includes/uploads
- cURL request to plugin repository fails 403
- Curl error while creating user
- Call external API in wordpress based on user input
- Inconsistencies between wp_remote_post and cURL
- Set wordpress auth cookie from external site?
- Does wp_remote_post() require curl?
- wp_remote_post vs curl to send data in WordPress plugin
- After upgrading WordPress, I am getting the following error. Error message: cURL error 52: Empty reply from server
- JSONDecodeError: Expecting value: line 1 column 1 (char 0)
- curl: (60) SSL certificate problem: unable to get local issuer certificate
- HTTP POST and GET using cURL in Linux [duplicate]
- JSONDecodeError: Expecting value: line 1 column 1 (char 0)
- JSONDecodeError: Expecting value: line 1 column 1 (char 0)
- How to use Python to execute a cURL command?
- How to use Python to execute a cURL command?
- How to use the curl command in PowerShell?
- What does HTTP/1.1 302 mean exactly?
- How to capture cURL output to a file?
- What are all the possible values for HTTP “Content-Type” header?
- How to use cURL to send Cookies?
- CURL ERROR: Recv failure: Connection reset by peer – PHP Curl
- curl POST format for CURLOPT_POSTFIELDS
- tar: Unrecognized archive format error when trying to unpack flower_photos.tgz, TF tutorials on OSX
- HTTP Error 411, The request must be chunked or have a content length
- Passing headers with axios POST request
- Curl not recognized as an internal or external command, operable program or batch file
- WebException (Status: Protocol Error)
- PHP cURL HTTP PUT
- Curl : connection refused
- file_get_contents( ) not working
- How to disable cURL SSL certificate verification
- Getting error in Curl – Peer certificate cannot be authenticated with known CA certificates
- Are HTTP headers case-sensitive?
- whats the meaning of curl “-s” and “-m”
- HTTP request on localhost failing
- Add media with WP-Rest-API v2 II
- wp_remote_get() to get AJAX url /wp-admin/admin-ajax.php
- How to automate filing a form as a user
- WordPress API returns empty page when page is less than X-WP-TotalPages
- Create a WordPress post using curl comand from Linux console?
- Creating login session via CURL
- File Type Is Not Permitted – Cronjob
- Download failed cURL error 7: . Can’t update anything
- Upload to a remote server using wp_remote_post
- Where Does WordPress Make cURL Requests? How To Add cURL Option
- export a csv file from the database with a cronjob
- How to create a post using REST API with sending data as a JSON body?
- WordPress curl timing out and saying ‘Moved Permanently’
- PHP to Handle API Return instead of print
- Curl requests sent two times
- get post content of particular post by url
- curl problem or permalinks
- Use WP admin AJAX url to hide API key
- Using PODS data with save_post
- Get single item from cURL plugin API call inside bash [closed]
- Uploading a media item with the wp-json API to a specific path
- REST API works in browser and via AJAX but fails via cURL
- Use WordPress user database in external php application
- calling admin-ajax.php from admin-ajax.php
- Using file_get_contents within admin but keep logged in
- Installation failed: 504 – Gateway Timeout
- Hide response returned from WordPress REST API call
- mysqli_query(): MySQL server has gone away for Curl Request
- Contactform7: display results from CURL
- Update products with curl (bash)
- How to send user data from one website to another
- Installation problem with wordpress xampp
- Authentication over CURL
- Blocking the direct access to images in the upload folder WordPress
- cURL error 28: SSL connection timeout while can download the plugin file
- rest_cannot_create_user – Sorry, you are not allowed to create new users. CURL WORDPRESS REST API
- Displaying a remote SSL certificate details using CLI tools
- Curl: disable certificate verification
- Human readable format for http headers with tcpdump
- What is different about using admin-ajax.php in an endpoint and just submitting a form from the front end?
- Trouble Sending Elementor Form Data via cURL in WordPress