Question
Fixed Accept header property in http reqeust, can't change it
Hello,
I am using cf 23 and facing the issue when trying to communicate with remote api on spring.
This is my cf codebase:
var httpService = new http(url=url, method="DELETE", timeout=5);
httpService.addParam(type="header", name="Accept", value="application/json");
httpService.addParam(type="header", name="cfId", value="123");
httpService.addParam(type="header", name="cfToken", value="555-555");
var httpServiceResponse = httpService.send();
I am trying to delete import/test.xml file on sftp server and if I invoke the call from postman or anywhere else it will work but when I invoke this from CF in request headers it's always fixed accept=application/xml, text/xml;
here are headers from spring service
- REQUEST headers: [cfid=123; accept=application/xml, text/xml; charset=UTF-8; cftoken=555-555; user-agent=ColdFusion; content-length=0; host=localhost:8806; connection=Keep-Alive; accept-encoding=gzip,deflate]
What ever I do I can't change Accept Header param value!
It says here in Providing accept header that any call with .xml, the accept parameter would be set to application\xml
https://helpx.adobe.com/coldfusion/developing-applications/changes-in-coldfusion/restful-web-services-in-coldfusion.html
I honestly do not want to change spring service because of this.
Please let me know if there is a way to change this and how can I enforce correct Accept value or remove the header property complely?!
Thanks in advance
What ever I do I can't change Accept Header param value!
It says here in Providing accept header that any call with .xml, the accept parameter would be set to application\xml
https://helpx.adobe.com/coldfusion/developing-applications/changes-in-coldfusion/restful-web-services-in-coldfusion.html
I honestly do not want to change spring service because of this.
Please let me know if there is a way to change this and how can I enforce correct Accept value or remove the header property complely?!
Thanks in advance
