Loading README.md +7 −1 Original line number Original line Diff line number Diff line Loading @@ -102,10 +102,14 @@ rp(options) ### POST data to a JSON REST API ### 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 ``` js var options = { var options = { method: 'POST', method: 'POST', uri: 'http://posttestserver.com/post.php', uri: 'http://api.posttestserver.com/post', body: { body: { some: 'payload' some: 'payload' }, }, Loading @@ -123,6 +127,8 @@ rp(options) ### POST like HTML forms do ### POST like HTML forms do Set option.form to encode the body as HTML form ``` js ``` js var options = { var options = { method: 'POST', method: 'POST', Loading Loading
README.md +7 −1 Original line number Original line Diff line number Diff line Loading @@ -102,10 +102,14 @@ rp(options) ### POST data to a JSON REST API ### 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 ``` js var options = { var options = { method: 'POST', method: 'POST', uri: 'http://posttestserver.com/post.php', uri: 'http://api.posttestserver.com/post', body: { body: { some: 'payload' some: 'payload' }, }, Loading @@ -123,6 +127,8 @@ rp(options) ### POST like HTML forms do ### POST like HTML forms do Set option.form to encode the body as HTML form ``` js ``` js var options = { var options = { method: 'POST', method: 'POST', Loading