wwJsonServiceClient::CreatewwHttp

Allows overriding the default wwHTTP instance used to send a request to the server.

Use this method if you need to add custom headers, authentication or prefill the post data of the Http request before making your service call.

You can override this method in a subclass or you can explicitly call the method with a custom wwHTTP instance.

oProxy = CREATEOBJECT("wwJsonServiceClient")

*** Create custom Http Object for Authentication
loHttp = loProxy.CreatewwHttp()

*** Now make customization to the HTTP object
loHttp.cUsername = "ricks"
loHttp.cPassword = "seekrit22"
loHttp.AddHeader("user_token","ads333rv1f32")


*** Proxy will use this loHttp instance internally
loArtist = loProxy.CallService("http://albumviewerswf.west-wind.com/api/artist",loArtist,"PUT")

IF  loProxy.lError
   ? loProxy.cErrorMsg
   RETURN
ENDIF

? loArtist.Albums.Count
o.CreatewwHttp(loHttp)

Return Value

wwHttp instance

Parameters

loHttp
optional - an already configured HTTP instance that overrides default wwHttp behavior. The base class simple does CREATEOBJECT("wwHttp").

Remarks

Call this method before you make the service call.


See also:

Class wwJsonServiceClient

© West Wind Technologies, 1996-2019 • Updated: 03/05/18
Comment or report problem with topic