• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfhttp param strip new line from paramter

New Here ,
Mar 23, 2015 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

281

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
community guidelines
Community Expert ,
Mar 24, 2015 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?

Votes

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
community guidelines
New Here ,
Mar 24, 2015 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?

Votes

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
community guidelines
Community Expert ,
Mar 24, 2015 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.

Votes

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
community guidelines
New Here ,
Mar 25, 2015 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.

Votes

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
community guidelines
Community Expert ,
Mar 25, 2015 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.

Votes

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
community guidelines
New Here ,
Mar 27, 2015 Mar 27, 2015

Copy link to clipboard

Copied

LATEST

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

Votes

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
community guidelines
Resources
Documentation