Last active
July 10, 2019 00:17
-
-
Save robertz/2c854e3bc9da1f69bf391963cf24eb2a to your computer and use it in GitHub Desktop.
example httpRequest file
This file contains hidden or 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
<cfscript> | |
baseUrl = "https://jsonplaceholder.typicode.com"; | |
api = new API(); | |
api | |
.setUrl( baseUrl & '/posts') | |
.execute(); | |
writeDump(api.getResult()); | |
put = new API(); | |
put | |
.setUrl( baseUrl & '/posts/1') | |
.setVerb('PUT') | |
.setBody({ | |
id: 1, | |
title: 'foo', | |
body: 'bar', | |
userId: 1 | |
}) | |
.execute(); | |
writeDump(put.getResult()); | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment