How do I use CURL to post a URL to an API endpoint? or What’s the correct syntax for a CURL post a UR

14 Replies, 602 Views

Hey noob here too but I just figured this out last week! For CURL post a URL with JSON, this worked for me:

```
curl -X POST https://api.example.com/data \
-H "Content-Type: application/json" \
-d '{"url":"https://my-site.com"}'
```

If it’s still broken, maybe the API wants a different field name? Like `"link"` instead of `"url"`.

For debugging, I use `-i` to see headers. Super helpful!

Messages In This Thread



Users browsing this thread: 1 Guest(s)