In the main method of EnsLib.HTTP.OutboundAdapter
- SendFormDataArray
line 5 you can see the following code:
#; Create an Http Request Object
Set tHttpRequest=$S($$$IsdefObject(pHttpRequestIn):pHttpRequestIn,1:##class(%Net.HttpRequest).%New()) $$$ASSERT($IsObject(tHttpRequest)&&tHttpRequest.%IsA("%Net.HttpRequest"))
Which creates a new empty %Net.HttpRequest
object, unless pHttpRequestIn
(3rd arg) has been passed with a custom request object. Most wrapper methods (VERB
, VERBURL
and VERBFormDataArray
) do not pass pHttpRequestIn
so you should get a fresh request object every time, but SendFormData
and SendFormDataURL
would pass pHttpRequestIn
from caller, if given.
Another place to look into is a Send
call:
Set tSC=tHttpRequest.Send($ZCVT(pOp,"U"),$G(pURL,..URL),..#DEBUG)
It has the following signature:
Method Send(type As %String, location As %String, test As %Integer = 0, reset As %Boolean = 1) As %Status
reset
arg defaults to 1
, and when it's true the Reset
method of %Net.HttpRequest
is called after every request. Reset
method removes headers (among other things). As you can see in the implementation:
Kill i%Headers,i%FormData,i%Params
EnsLib.HTTP.OutboundAdapter
never calls Send
with reset=0
, so the request should be reset every time.
That said, how do you call SendFormDataArray
?
I took a look at the article you linked to. Can you add logging to GetRequest
method? It should be called on every business operation message.
Hello.
I agree it works great for ObjectScript code, but it sits at an empy method invocation unfortunately. And I need not even my method, but library calls.







That's convenient!