0 Replies - 748 Views - Last Post: 21 November 2017 - 11:26 AM Rate Topic: -----

#1 midasxl   User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 215
  • Joined: 03-December 08

Get response URL from cfhttp REST call

Posted 21 November 2017 - 11:26 AM

Greetings and thanks for reading!

I have been tasked with creating an interface to interact with a REST service that ingests XML files.

I am using the CFHTTP functionality of ColdFusion to do so.

The REST service is set up so that the first response that I receive is a 405 - Method Not Allowed.

From this, I am supposed to get the jsessionid from the URL and use that and the "Set-Cookie" value to call the service again.

I can get all sorts of things in the CFHTTP object struct, including the "Set-Cookie" value.

<h4>Dump of CFHTTP Object:</h4>
	<cfdump var="#result#" />
	<cfset content = result.Responseheader["Status_Code"] />
	<h4>Dump of Status-Code from Responseheader sub-struct:</h4>
	<cfdump var="#content#" />
	<cfset setcookiesA = result.Responseheader["Set-Cookie"] />
	<h4>Dump of Set-Cookie from response header</h4>
	<cfdump var="#setcookiesA#" />

But how do I get the jsessionid out of the URL? What URL are they talking about? I've never tried this before, so I don't know where to start.

Thanks for any insight, direction, solution you may be able to provide.


Is This A Good Question/Topic? 0
  • +

Page 1 of 1