Skip to content

Instantly share code, notes, and snippets.

@edutrul
Created August 7, 2015 23:07
Show Gist options
  • Save edutrul/f16aef85b6bda9685960 to your computer and use it in GitHub Desktop.
Save edutrul/f16aef85b6bda9685960 to your computer and use it in GitHub Desktop.
How to do a simple POST in REST?
Here's my script:
POST /livex/api/contact_form HTTP/1.1
Host: local.testdrupal.com
Content-Type: application/hal+json
Authorization: Basic bGl2ZXg6MTM1NzkwLi4=
Cache-Control: no-cache
Postman-Token: 1b64499c-5091-588e-f72e-e2202dc066b6
{
"_links": {
"type": {
"href":"http://local.testdrupal.com/rest/type/api/contact"
}
},
"name":[
{
"value": "Eduardo"
}
],
"mail":[
{
"value": "luis.eduardo.telaya@gmail.com"
}
],
"subject":[
{
"value": "Testing Post Contact"
}
],
"message":[
{
"value": "New Mail"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment