Skip to content

Instantly share code, notes, and snippets.

@robertz
Last active July 10, 2019 00:17
Show Gist options
  • Save robertz/2c854e3bc9da1f69bf391963cf24eb2a to your computer and use it in GitHub Desktop.
Save robertz/2c854e3bc9da1f69bf391963cf24eb2a to your computer and use it in GitHub Desktop.
example httpRequest file
<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