Created
August 7, 2015 23:07
-
-
Save edutrul/f16aef85b6bda9685960 to your computer and use it in GitHub Desktop.
How to do a simple POST in REST?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": "[email protected]" | |
} | |
], | |
"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