Mastering cURL POST Requests with ProxyTee
Learn how to send cURL POST requests with JSON payloads, custom headers, and HTTP or SOCKS5 proxy authentication for API testing and scraping.

Learn how to send cURL POST requests with JSON payloads, custom headers, and HTTP or SOCKS5 proxy authentication for API testing and scraping.
curl is a powerful command-line tool that allows you to transfer data using various network protocols. It's widely used for sending HTTP requests directly from your terminal, making it an essential utility for developers and anyone working with APIs or web scraping. This guide will walk you through sending POST requests using curl, with a focus on how ProxyTee can enhance your data transfer process.
What Is a POST Request?
A POST request is an HTTP method used to send data to a server, placing the data in the request body rather than in the URL, like with a GET request. This method allows for more discreet data transmission and accommodates significantly larger data payloads, overcoming the URL length limits of GET requests. POST requests are commonly used to submit forms, upload files, or transmit JSON data to APIs.
How to Send a POST Request with curl
Before diving into sending POST requests, ensure that curl is installed on your system. You can verify this by running curl --version in your terminal. If it's not installed, follow the instructions below for your operating system.
Install curl
Here's how to install curl on various operating systems:
Windows:
- Use
winget install curl.curlorchoco install curl.
Linux:
- On Ubuntu/Debian:
apt-get install curl - On Red Hat/CentOS/Fedora:
yum install curl - On OpenSUSE:
zypper install curl - On Arch Linux:
pacman -Sy curl
macOS:
- Install via Homebrew:
brew install curl
Make a POST Request
curl offers numerous options for sending POST requests. Let's explore the key features you'll need.
Specify the POST Method
To indicate you're sending a POST request, use the -X POST flag, or equivalently, --request POST. This command specifies the HTTP method:
curl -X POST https://httpbin.org/anything
httpbin.org is a tool that returns request data in the response, allowing you to verify your request’s content.
Set the Content-Type
Specifying the content type is crucial for the server to correctly interpret the request data. The Content-Type header uses MIME types to define the request body format, such as application/json for JSON data or application/xml for XML.
To set the content type using the -H flag:
curl -X POST -H 'Content-Type: application/json' -d '{}' https://httpbin.org/anything
The response will now show Content-Type set as application/json.
Send Data
Use the -d flag to send data in the request body. For example:
curl -X POST -H 'Content-Type: application/json' -d '{"FirstName": "Joe", "LastName": "Soap"}' https://httpbin.org/anything
For larger data or file uploads, reference the file with @. To send the content of body.json, run:
curl -X POST -H 'Content-Type: application/json' -d @body.json https://httpbin.org/anything
Send JSON Data
You can explicitly set the content type and accept header to application/json. Alternatively, starting with curl version 7.82, use the --json flag:
curl -X POST --json '{"FirstName": "Joe", "LastName": "Soap"}' https://httpbin.org/anything
This command simplifies sending JSON data, setting both the Content-Type and Accept headers automatically.
Send XML Data
To send XML data, use application/xml as the Content-Type and Accept headers:
curl -X POST -H 'Content-Type: application/xml' -H 'Accept: application/xml' -d '<Person><FirstName>Joe</FirstName><LastName>Soap</LastName></Person>' https://httpbin.org/anything
Send FormData
To submit form data as key-value pairs, use the -F flag:
curl -X POST -F FirstName=Joe -F LastName=Soap https://httpbin.org/anything
Upload Files
Upload files via FormData using @:
curl -X POST -F https://httpbin.org/anything
Send Credentials
To include credentials for basic authentication, use the -u flag:
curl -X POST -u 'admin:password123' --json '{"FirstName": "Joe","LastName": "Soap"}' https://httpbin.org/anything
The user credentials will be encoded and included in the Authorization header.
Enhanced Data Transfer with ProxyTee
ProxyTee provides rotating residential proxies, enabling you to perform various internet activities, including data extraction, with enhanced anonymity and efficiency. By integrating ProxyTee, you ensure your requests originate from different IPs, bypassing rate limits and blocks. Here's how to leverage ProxyTee's key features when making cURL POST requests:
- Unlimited Bandwidth: Perform data-intensive operations without bandwidth concerns using ProxyTee's unlimited bandwidth feature, essential for extensive scraping or large file uploads.
- Global IP Coverage: Access geographically diverse data with more than 30 million IP addresses across 100+ countries, ideal for location-specific tasks, by leveraging ProxyTee's Global Coverage.
- Multiple Protocol Support: Ensure compatibility with a variety of applications and tools using both HTTP and SOCKS5 protocols. Learn more about the supported proxy protocols here.
- Automatic IP Rotation: Benefit from ProxyTee’s Auto-Rotation that allows IP addresses to change automatically at intervals from 3 to 60 minutes.
- Simple API: Integrate ProxyTee into various applications with the simple API integration, and streamline your data-gathering operations.
- Affordable Pricing: Gain high value for all kinds of users with ProxyTee's competitive pricing.
Important cURL Arguments
Here's a summary of common curl arguments:
| Argument | Full Option | Short Description |
|---|---|---|
-X |
--request |
Specify HTTP method used |
-d |
--data |
Send request body data |
-F |
--form |
Send form-based data |
-H |
--header |
Set request header fields |
-i |
--include |
Include response headers output |
-v |
--verbose |
Show extra debug details |
-L |
--location |
Follow redirects automatically |
-o |
--output |
Write response to file |
-O |
--remote-name |
Save as remote filename |
-C |
--continue-at |
Resume transfer from offset |
-u |
--user |
Set basic auth credentials |
-x |
--proxy |
Use specified proxy server |
-k |
--insecure |
Skip SSL certificate checks |
-I |
--head |
Fetch headers only (HEAD) |
-b |
--cookie |
Send stored cookies data |
-c |
--cookie-jar |
Write cookies to file |
-e |
--referer |
Set Referer header |
-A |
--user-agent |
Set custom User-Agent |
-m |
--max-time |
Maximum request time limit |
--max-filesize |
(no short form) | Limit downloaded file size |
-z |
--time-cond |
Download if modified since |
--compressed |
(no short form) | Request compressed response |
--data-urlencode |
(no short form) | URL-encode data fields |
--interface |
(no short form) | Bind to specific interface |
-w |
--write-out |
Print custom response info |
-r |
--range |
Request specific byte range |
-s |
--silent |
Suppress progress output |
-f |
--fail |
Fail silently on errors |
-g |
--globoff |
Disable bracket expansions |
--http1.0 |
(no short form) | Use HTTP/1.0 protocol |
--http1.1 |
(no short form) | Use HTTP/1.1 protocol |
--http2 |
(no short form) | Use HTTP/2 protocol |
--http3 |
(no short form) | Use HTTP/3 protocol |
-Z |
--parallel |
Send requests simultaneously |
--proxy-user |
(no short form) | Proxy authentication credentials |
--digest |
(no short form) | Use HTTP Digest auth |
--ntlm |
(no short form) | Use HTTP NTLM auth |
--negotiate |
(no short form) | Use SPNEGO/Kerberos auth |
Conclusion
This guide covered sending POST requests using curl and showed how to specify the request method, set Content-Type and Accept headers, and transmit data in different formats, including JSON, XML, and FormData. You've also learned how to handle file uploads and incorporate basic authentication using -u. Explore curl further, for instance, you could see the option of sending cookies with requests or leveraging the tool through ProxyTee's unlimited residential proxies for secure and scalable web data extraction. The tool offers more complex settings and features which you can incorporate in any programming language, whether Python, Node.js or Rust.
Scale Your Web Scraping with ProxyTee
Ready to eliminate IP bans and per-gigabyte bandwidth overages? Explore ProxyTee Unlimited Residential Proxies, learn how our unlimited bandwidth residential proxy ports work, check our proxies for travel fare aggregation, or test endpoints on our free proxy list.
Frequently Asked Questions
Target websites use ASN filtering, rate limiting, and TLS fingerprinting to block datacenter IP ranges. Routing your requests through ProxyTee's 30M+ real household residential IPs across 100+ countries ensures high success rates without CAPTCHA interruptions.
Principal infrastructure engineer at ProxyTee specializing in rotating residential proxy networks, SOCKS5/HTTP tunneling, TLS fingerprint mitigation, and distributed data extraction pipelines.


