-
-
Save SidneyAllen/5200476 to your computer and use it in GitHub Desktop.
This file contains 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
<cfprocessingdirective pageencoding="utf-8" /> | |
<!--- cfcontent is also important for unicode ---> | |
<cfcontent type="text/html charset=utf-8"> | |
<!--- set up the parameters ---> | |
<cfset sConsumerKey = 'yourPublickey'> <!--- Paste your dev or prod keys here ---> | |
<cfset sConsumerSecret = 'youPrivatekey'> <!--- Paste your dev or prod keys here ---> | |
<cfset OAUTH_VERIFIER = '' /> <!--- You get back these when doing oauth registration ---> | |
<cfset token = '' /> <!--- You get back these when doing oauth registrationt ---> | |
<cfset tokenSecret = '' /> <!--- You get back these when doing oauth registration ---> | |
<!--- set up the required objects including signature method---> | |
<cfset oReqSigMethodSHA = CreateObject("component", "oauth.oauthsignaturemethod_hmac_sha1")> | |
<cfset oToken = CreateObject("component", "oauth.oauthtoken").init(sKey = token, sSecret = tokenSecret)> | |
<cfset oConsumer = CreateObject("component", "oauth.oauthconsumer").init(sKey = sConsumerKey, sSecret = sConsumerSecret)> | |
<cfset oReq = CreateObject("component", "oauth.oauthrequest").fromConsumerAndToken( | |
oConsumer = oConsumer, | |
oToken = oToken, | |
sHttpMethod = "GET", | |
sHttpURL = 'https://api.stackmob.com/markets?_expand=0')> <!--- For now, just trying to get the market info, change it to you own url. ---> | |
<cfset oReq.signRequest( | |
oSignatureMethod = oReqSigMethodSHA, | |
oConsumer = oConsumer, | |
oToken = oToken)> <!--- Sign the request ---> | |
<cfhttp url="#oReq.GETNORMALIZEDHTTPURL()#" method="get"> | |
<cfhttpparam encoded="no" type="CGI" name="accept" value="application/vnd.stackmob+json; version=0"> | |
<cfhttpparam type="header" name="authorization" value="#oReq.TOHEADER()#" /> | |
</cfhttp> | |
<cfdump var="#cfhttp#" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment