Skip to main content
vikrantn20740057
Participating Frequently
March 23, 2015
Question

cfhttp param strip new line from paramter

  • March 23, 2015
  • 3 replies
  • 402 views

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

This topic has been closed for replies.

3 replies

vikrantn20740057
Participating Frequently
March 25, 2015

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

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

BKBK
Community Expert
Community Expert
March 25, 2015

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.

vikrantn20740057
Participating Frequently
March 27, 2015

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

vikrantn20740057
Participating Frequently
March 25, 2015

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?

BKBK
Community Expert
Community Expert
March 25, 2015

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.

BKBK
Community Expert
Community Expert
March 24, 2015

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?