<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>12 Nov 2015 10:04:00 Z</lastBuildDate><pubDate>11 Nov 2015 00:35:00 Z</pubDate><description>I am having difficulties when passing header information in an httpRequest variable. If you look at the attached code the HTTPRequest function works fine but then when using the httpRequest variable with exactly the same header the website responds with an error. I need to use httpRequest variable because I need to use PUT elsewhere with the API which is not supported by the HTTPRequst function.&#13;
Am I passing the header information correctly to the httpRequest variable - if not how should it be passed?&#13;
sHeader is string&#13;
sUrltouse is string&#13;
HTTP_Res is string&#13;
HTTPError is string&#13;
&#13;
&#13;
sUrltouse = "a website"&#13;
sHeader = "Accept: application/json"+CR&#13;
testapi is httpRequest&#13;
testapi..Method = httpGet&#13;
testapi..URL = sUrltouse&#13;
&#13;
testapi..IgnoreError = httpIgnoreInvalidCertificate&#13;
&#13;
testapi..Header["A"] = sHeader&#13;
HTTP.IgnoreError = httpIgnoreInvalidCertificate&#13;
&#13;
&#13;
HTTPRequest(sUrltouse,"",sHeader,"","","","")&#13;
&#13;
&#13;
HTTP_Res = HTTPGetResult()&#13;
IF Length(HTTP_Res) = 0 THEN&#13;
// Error of the Web server, the error details are found in the header of the page&#13;
HTTPError = HTTPGetResult(httpHeader)&#13;
Error(HTTPError)&#13;
END&#13;
HTTPError = HTTPGetResult(httpHeader)&#13;
Info(HTTPError)&#13;
&#13;
&#13;
Info(HTTP_Res)&#13;
&#13;
&#13;
apiresponse is httpResponse = HTTPSend(testapi)&#13;
IF ErrorOccurred THEN&#13;
Error(ErrorInfo(errFullDetails))&#13;
ELSE&#13;
Info(apiresponse..RoughHeader)&#13;
Info(apiresponse..Content)&#13;
&#13;
&#13;
END</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54898-adding-headers-httprequest-variable/read.awp</link><title>Adding headers to an httpRequest variable in WD 20</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54898-adding-headers-httprequest-variable-54917/read.awp</comments><pubDate>12 Nov 2015 10:04:00 Z</pubDate><description>Hi,&#13;
&#13;
I use the header in this way&#13;
&#13;
MyRequest..Header["Mode"] = sCustomHeader+[CRLF]&#13;
and this works.&#13;
&#13;
Also make sure the C…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54898-adding-headers-httprequest-variable-54917/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54898-adding-headers-httprequest-variable-54917/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54898-adding-headers-httprequest-variable/read.awp">Adding headers to an httpRequest variable in WD 20</source><title>Re: Adding headers to an httpRequest variable in WD 20</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54898-adding-headers-httprequest-variable-54914/read.awp</comments><pubDate>11 Nov 2015 18:46:00 Z</pubDate><description>What is the error being returned?&#13;
&#13;
Have you tried hitting the site with Chrome and then checking the console to see what "Cont…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54898-adding-headers-httprequest-variable-54914/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54898-adding-headers-httprequest-variable-54914/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54898-adding-headers-httprequest-variable/read.awp">Adding headers to an httpRequest variable in WD 20</source><title>Re: Adding headers to an httpRequest variable in WD 20</title></item></channel></rss>
