How to call a Java API in ColdFusion? -
i using cf10. want know how call api of other application. receiving base64 encoded string named "token" different java application. unencoded version user’s cid, username, , uuid separated comma, this: 178,username,a5f5ff2f-8d87-4656-821d-99e62daf512b. , base64 encoded string like: mtc4lgfpbxn3zwisytvmnwzmmmytogq4ny00nju2ltgymwqtotllnjjkywy1mtji.
so, have done - have converted encoded string variables. catching string in form scope.
<cfif isdefined("form.token") , len(trim(form.token)) not 0> <cfset variables.actualtokenstring = tostring(tobinary(form.token))> <cfset session.customerid = listgetat(variables.actualtokenstring, 1, ",")> <cfset session.username = listgetat(variables.actualtokenstring, 2, ",")> <cfset session.uuid = listgetat(variables.actualtokenstring, 3, ",")> </cfif> now, want - upon receiving unique login token, need call 'that' application's api validate token , post json. have used "cfhttp" that. below:
<cfhttp url="https://aw-tst-staging.pearsondev.com/api/awlegacy" method="post" result="result"> <cfhttpparam type="formfield" name="cid" value="#session.customerid#"> <cfhttpparam type="formfield" name="username" value="#session.username#"> <cfhttpparam type="formfield" name="uuid" value="#session.uuid#"> </cfhttp> am doing right? can please help?
Comments
Post a Comment