Skip to content

Instantly share code, notes, and snippets.

@jarrodbell
Created June 20, 2011 01:03
Show Gist options
  • Save jarrodbell/1034969 to your computer and use it in GitHub Desktop.
Save jarrodbell/1034969 to your computer and use it in GitHub Desktop.
PUT request using CF.request
var baseURL = "www.someurl.com";
var theURL = "/some/url?param=test";
var headerString = "\
PUT "+theURL+" HTTP/1.1\r\n\
Host: "+baseURL+"\r\n\
Accept-Encoding: gzip, deflate\r\n\
Content-Type: text/xml\r\n\
Content-Length: ";
var bodyString = <?xml version=\"1.0\" encoding=\"UTF-8\"?><reltime href=\"" + myRelLease + "\" val=\"PT60S\" />";
CF.request( theUrl, headerString + bodyString.length + "\r\n" + bodyString + "\r\n\r\n", startWatchPoll );
function startWatchPoll( status, headers, body ) {
console.log( "startWatchPoll( " + status + ", " + headers + ", " + body + " )" );
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment