A lightning talk about cURL
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

482 B

HTTP POST File

  • -d @FILE - Send FILE with the request
  • -X METHOD - Set HTTP request method
  • -H HEADER - Add HEADER to request headers
$ cat data.json
{"name": "brett","talk": "curl"}
$ curl -X POST -d @data.json \
  -H "Content-Type: application/json" http://httpbin.org/post
{
  "data": "{\"name\": \"brett\",\"talk\": \"curl\"}",
  "json": {
    "talk": "curl",
    "name": "brett"
  },
  "headers": {
    "Content-Type": "application/json",
    ...
}