Highlighted

Status Code as Integer

New Here ,
Feb 17, 2017

Copy link to clipboard

Copied

Guys,

We are integrating with a third party app which is making an HTTPRequest call to our IIS server.  Unfortunately, the process is failing on their end (which is using Ruby), because the status_code of 200 is returning as a datatype of string rather then integer.  Is there a way to configure the CFHTTP header or other processes in order to force the status_code to a datatype of integer rather then string.

Thanks - N

Views

171

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Status Code as Integer

New Here ,
Feb 17, 2017

Copy link to clipboard

Copied

Guys,

We are integrating with a third party app which is making an HTTPRequest call to our IIS server.  Unfortunately, the process is failing on their end (which is using Ruby), because the status_code of 200 is returning as a datatype of string rather then integer.  Is there a way to configure the CFHTTP header or other processes in order to force the status_code to a datatype of integer rather then string.

Thanks - N

Views

172

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Feb 17, 2017 0
Adobe Community Professional ,
Feb 19, 2017

Copy link to clipboard

Copied

The status code may in fact be 200 OK, not just 200.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 19, 2017 0
New Here ,
Feb 20, 2017

Copy link to clipboard

Copied

I reviewed the CFHTTP output on the page and the status_code (which is the value they are using) is a '200', furthermore, when I get the value and do an isNumeric it appears to be numeric, however, Ruby doesn't seem to agree...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 20, 2017 0
Adobe Community Professional ,
Feb 22, 2017

Copy link to clipboard

Copied

You are in Ruby. So, in client-server lingo, you are the client. ColdFusion is the server.

If status_code comes in as a string, then that is the gateau you get from the bakery. Things get awkward when you start to require that the baker change his ingredients.

Ruby should just accept the string value. (Remember, string is the most interoperable data type between different software systems). In Ruby, conversion from string to integer is straightforward: x.to_i

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 22, 2017 0
Engaged ,
Feb 22, 2017

Copy link to clipboard

Copied

When consuming data from another system you need to take it as it comes.  You should be able to easily check the returned status code and figured out it is a 200 without needing it to be an integer.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 22, 2017 0