thecfguy

A Unique Developer

Calling LinkedIn API from RAILO with CFHTTP generate error

Since couple of weeks working with various social API integration in RAILO and most of the API I was calling using CFHTTP tag. While creating API for LinkedIn I start getting error since LinkedIn wasn't able to resolve URL that I was sending. From error message it turn out that RAILO encode full URL instead of only query paramters. Below is code for LinkedIn API to get people search where URL itself contains special characters like ), : etc. which are encoded while passing it through CFHTTP.

While researching on this issue I had tested it on ColdFusion and it work fine on ACF. Below is response from ColdFusion and RAILO.

Response from RAILO:

Struct
errorCode
number 0
message
string Unknown field {people-search%3A%28people%3A%28id%2Cfirst-name%2Clast-name%29%29} in resource {Root}
requestId
string 11N0283P7P
status
number 400
timestamp
number 1381903616886

 

Response from ColdFusion:

struct
people
struct
_count 2
_start 0
_total 110
values
array
1
struct
firstName Pritesh
id _XE1Tl
lastName Patel
2
struct
firstName Pritesh
id iliynIV
lastName Patel

 

As temporary solution I have use CURL command line utility to call LinkedIn API.