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
- curl: (60) SSL certificate problem: unable to get local issuer certificate
- How do I install and use cURL on Windows?
- 403 Forbidden vs 401 Unauthorized HTTP responses
- What’s the net::ERR_HTTP2_PROTOCOL_ERROR about?
- How to use the curl command in PowerShell?
- https connection using CURL from command line
- Failed to load PDF document in Chrome
- How to define the basic HTTP authentication using cURL correctly?
- Possible reason for NGINX 499 error codes
- What is the correct JSON content type?
- “CAUTION: provisional headers are shown” in Chrome debugger
- @ converted to %40 in HTTPPost request
- What is the correct JSON content type?
- Curl command for https ( SSL )
- PHP + curl, HTTP POST sample code?
- What is the curl error 52 “empty reply from server”?
- What is “X-Content-Type-Options=nosniff”?
- What is “X-Content-Type-Options=nosniff”?
- curl: (6) Could not resolve host: google.com; Name or service not known
- Access Control Request Headers, is added to header in AJAX request with jQuery
- Call to undefined function curl_init().?
- How to use cURL to send Cookies?
- cURL error 60: SSL certificate: unable to get local issuer certificate
- What’s the point of the X-Requested-With header?
- Binary Data Posting with curl
- What exactly is cacert.pem for?
- Duplicate headers received from server
- SON Post with Customized HTTPHeader Field
- PHP cURL custom headers
- Why does cURL return error “(23) Failed writing body”?
- Error:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
- Setting Curl’s Timeout in PHP
- cURL request in Laravel
- curl: no URL specified for restful api
- When looking at the differences between X-Auth-Token vs Authorization headers, which is preferred?
- How to read a CSV file from a URL with Python?
- Is it safe to use sslverify => true for with wp_remote_get/wp_remote_post
- cURL 28 error after switch from to brew php 7.2 on localhost
- Re use authenticated HTTP connection or cUrl handle
- Passing .pem and .key files in cURL doesn’t work in WordPress
- Creating a post with the REST API, curl and oauth returning 401 error
- Is curl required?
- Retrieving Google Plus share count with wp_remote_post
- cURL error 60: SSL certificate problem: unable to get local issuer certificate
- Use wp_remote_get to get JSON instagram feed from public profile
- Login WordPress website using wp-rest api
- How to convert this cURL to wp_remote_get?
- On Plugin Activation, How Do I Check for Proper Transport Mechanism?
- Problem with cURL and rest API
- Programmatic Login from 3rd Party site
- Why is json_decode failing?
- WordPress from url get external source title
- Update File Once Every 30 Days
- Get single item from cURL plugin API call inside bash [closed]
- cURL error for cron
- WordPress transient not working with WP Engine
- SOAP Request/Parsing XML From wp_send_json_success
- Accessing an API with jQuery and AJAX
- Error: Can´t access facebook comment plugin admin page
- Simulating timeout is not working
- WP Refused to display ‘URL’ in a frame because it set ‘X-Frame-Options’ to ‘sameorigin’
- Sending WordPress database information to cross domain the safe way?
- Run WordPress Plugin in the Specified time
- wordpress database error
- Get full page HTML for a non-public WordPress page
- Is it possible to make WordPress as a RESTful app?
- How to use the HTTP API (wp_remote_get) instead of cURL?
- rest_cannot_create_user – Sorry, you are not allowed to create new users. CURL WORDPRESS REST API
- cURL External API request displays content above other content on page