Highlighted

cfhttp param strip new line from paramter

New Here ,
Mar 23, 2015

Copy link to clipboard

Copied

Hi,

I am facing issue with <cfhttpparam> tag.

<cfhttpparam

        type="URL"

        name="auth_token"

        value="#strJsonData.result.authToken#"

  encoded="false"

        />

Here the value send strips new line because of which on the other end i am not able to fetch data w.r.t that value

Thanks and Regards

Vikrantraje

Views

184

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

cfhttp param strip new line from paramter

New Here ,
Mar 23, 2015

Copy link to clipboard

Copied

Hi,

I am facing issue with <cfhttpparam> tag.

<cfhttpparam

        type="URL"

        name="auth_token"

        value="#strJsonData.result.authToken#"

  encoded="false"

        />

Here the value send strips new line because of which on the other end i am not able to fetch data w.r.t that value

Thanks and Regards

Vikrantraje

Views

185

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
Mar 23, 2015 0
Adobe Community Professional ,
Mar 24, 2015

Copy link to clipboard

Copied

It is unclear what you mean. Did you attempt to get the value of URL.auth_token after a cfhttp post? Could you please explain what you did, what you expected and what actually happened?

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...
Mar 24, 2015 0
New Here ,
Mar 24, 2015

Copy link to clipboard

Copied

Hi BkBk,

1)Got URL.auth_token dynamically calling a service

2)Made another service to fetch details passing auth_token.

3)The problem lies when the service producer receives auth_token, its different from that which was send during 1st call .ie

auth_token during 1st service calls and later auth_token defer in "\n"(new line) character.

Hence it is certain that the when i send auth_token using <cfhttp> tag, it strips new line character and send auth_token.Why?

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...
Mar 24, 2015 0
Adobe Community Professional ,
Mar 24, 2015

Copy link to clipboard

Copied

Thanks for the explanation. <cfhttpparam type="URL"> sends data as key-value pairs appended to the URL. I would expect ColdFusion to automatically url-encode the information.

But you have set encoded="false". Hence my suggestion that you should test by deleting that attribute.

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...
Mar 24, 2015 0
New Here ,
Mar 25, 2015

Copy link to clipboard

Copied

Exactly..But i tried that..encoded attribute has no effect.

I think i need to handle it at web service producer end.

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...
Mar 25, 2015 0
Adobe Community Professional ,
Mar 25, 2015

Copy link to clipboard

Copied

vikrantn20740057 wrote:

Exactly..But i tried that..encoded attribute has no effect.

It was worth a try, but we shouldn't read much into it. After all, the documentation tells us the attribute is ignored.

I think i need to handle it at web service producer end.

Yes, I, too, am curious to know whether the problem happens before or during the web service call. Test by displaying or logging the value before and after the call, and comparing.

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...
Mar 25, 2015 0
New Here ,
Mar 27, 2015

Copy link to clipboard

Copied

Finally i had to handle it on service producer side.The <chttp> tag strips new line irrespective of encoding flag

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...
Mar 27, 2015 0