Question
· Jan 15, 2018

Headers in HttpRequest

 

Hi Guys,

I'm using Ensemble 2014 and have a code that Posts HttpRequest to a REST API and working fine, but don't know how to add Header to my request!?

I tried  Set Request.SetHeader("Source","Civicview") but it's bringing a Syntax error, any help pls?

 Set Request= ##class(%Net.HttpRequest).%New()


 // D Body.%ToJSON()
 Set Request.Server = "devtest.altus.net.au"
 Set Request.Location = "/STP_IF/rest/Employee/CivicCreate"
 //S Request.ProxyAuthorization="SVRWSVMhME4yOlVyYW51czY="
 Set Request.ContentType = "application/json"
 Set Request.SetHeader("Source","Civicview")
 Set Request.SetHeader("PayDate","2017.01.11")

thanks

Discussion (3)2
Log in or sign up to continue