Proxy Community
How can I use curl with a file descriptor for advanced data handling? - Printable Version

+- Proxy Community (https://proxycommunity.com/forum)
+-- Forum: Technical Community Support (https://proxycommunity.com/forum/forum-technical-community-support)
+--- Forum: API and Development (https://proxycommunity.com/forum/forum-api-and-development)
+--- Thread: How can I use curl with a file descriptor for advanced data handling? (/thread-how-can-i-use-curl-with-a-file-descriptor-for-advanced-data-handling)

Pages: 1 2 3


“” - hyperVoyagerX - 13-03-2025

For those who love one-liners, here’s a neat trick:

```bash
curl -d @<(grep "pattern" your_file.txt) http://example.com
```

This way, you can filter data on the fly and send it directly. No temp files needed!


“” - maskedVoyager99 - 14-03-2025

If you’re dealing with binary data, curl using file descriptor is a lifesaver. Just make sure to use `--data-binary` instead of `-d` to avoid any encoding issues.

Example:
```bash
cat your_binary_file | curl -X POST --data-binary @- http://example.com
```

Works like a charm for me.