function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
doubleminusdoubleminus 

Multiple headers in HttpRequest?

Quick question. If want to perform an HttpRequest but need to pass multiple headers...how do I do that?

 

request.setHeader('API-KEY', APIKEY);
request.setHeader('ACCEPT', 'text/xml');

 

Does line 2 overwrite line 1?

Best Answer chosen by Admin (Salesforce Developers) 
paul-lmipaul-lmi

line 2 would not overwrite line one, as long as the header name isn't the same, which is isn't in your example.  so you're good.

All Answers

paul-lmipaul-lmi

line 2 would not overwrite line one, as long as the header name isn't the same, which is isn't in your example.  so you're good.

This was selected as the best answer
doubleminusdoubleminus

Excellent - thank you!!

doubleminusdoubleminus

And Paul, in case you have any idea about this one...http://boards.developerforce.com/t5/Apex-Code-Development/Why-won-t-this-code-work/td-p/214803   Just bringing it to your attention.

 

Thanks.