0

I am using libcurl. I know how to send form data. I want, however, to send a "request payload", but I have no idea how to.

This is what an example of what I am trying to do, in Chrome Developer Tools: View image

Can anyone please help me?

1 Answers1

1

The command-line version of what you want would be something akin to:

curl --header "Content-Type: application/json" --data '{"data":"blob"}' http://address.com

(you'll probably want to include cookie information for authentication too)

I don't know how well that translates to libcurl, but that's the essence sending a request payload with curl.

blahdiblah
  • 33,069
  • 21
  • 98
  • 152
  • Thanks for the response. My question is, what's the difference between this and sending form data? Is it just the same thing, without the "x=y" format? –  Dec 01 '11 at 05:49
  • Thanks, I found my answer, which I posted below. Enjoy the bounty in a bit. –  Dec 01 '11 at 14:35