Quantcast
Channel: Adobe Community : Popular Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 14291

cfhttp and setting the content-type for a request

$
0
0

Hi,

 

I am trying to set the content-type for a cfhttp request like this (on coldfusion 9):

 

<cfhttp redirect="no" method="get" timeout="120" url="http://10.0.0.1/test2.cfm">

    <cfhttpparam type="HEADER" name="Content-Type" value="application/json; charset=utf-8">

</cfhttp>

 

// coding on test2.cfm:

<cfset x = GetHttpRequestData()>

<cfdump var=#x#>

 

// Output on test2.cfm

 

content [empty string]
headers
struct
Accept-Encoding deflate, gzip, x-gzip, compress, x-compress
Connection TE
Host 10.0.0.1:80
Proxy-Connection close
TE trailers, deflate, gzip, compress
User-Agent ColdFusion
X-REWRITE-URLhttp://10.0.0.1:80/test2.cfm
method GET
protocol HTTP/1.1

 

As you can see no content-type is send through. I also tried the sniffer.exe:

 

GET http://10.0.0.1:80/test2.cfm HTTP/1.1

Host: 127.0.0.1

Proxy-Connection: close

Connection: TE

TE: trailers, deflate, gzip, compress

User-Agent: ColdFusion

Accept-Encoding: deflate, gzip, x-gzip, compress, x-compress

 

Here you can also see that no content-type was passed through. The sniffer should report back

 

GET http://10.0.0.1:80/test2.cfm HTTP/1.1

Host: 127.0.0.1

Proxy-Connection: close

Connection: TE

TE: trailers, deflate, gzip, compress

User-Agent: ColdFusion

Accept-Encoding: deflate, gzip, x-gzip, compress, x-compress

Content-Type: application/json; charset=utf-8

 

But is does not, what do i need todo to set the content-type in a cfhttp request.

 

Kind regards,

Nebu


Viewing all articles
Browse latest Browse all 14291

Trending Articles