Skip to content

Commit

Permalink
Merge pull request #115 from EvanCarroll/master
Browse files Browse the repository at this point in the history
Doc updates
  • Loading branch information
analog-nico committed May 16, 2016
2 parents 2854e04 + c3bb0dc commit ee171f9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,14 @@ rp(options)

### POST data to a JSON REST API

Set option.body to data, and json:true to encode the body as JSON. See below
for HTML forms.


``` js
var options = {
method: 'POST',
uri: 'http://posttestserver.com/post.php',
uri: 'http://api.posttestserver.com/post',
body: {
some: 'payload'
},
Expand All @@ -123,6 +127,8 @@ rp(options)

### POST like HTML forms do

Set option.form to encode the body as HTML form

``` js
var options = {
method: 'POST',
Expand Down

0 comments on commit ee171f9

Please sign in to comment.