Need a simple curl POST example – can anyone share a quick snippet? or Struggling with a curl POST example – any

24 Replies, 1642 Views

400 errors are the worst. Here’s what works for me 99% of the time:

```
curl -H "Content-Type: application/json" -d '{"name":"test"}' https://example.com/api
```

Pro tip: If the API needs auth, slap on `-H 'Authorization: Bearer YOUR_TOKEN'`.

Also, check out Postman or Insomnia if you’re tired of debugging curl commands. They’re lifesavers for API testing.

Messages In This Thread



Users browsing this thread: 1 Guest(s)