Question:
*VFP 9 SP2
LOCAL loReq LOCAL loHttp LOCAL lnSuccess LOCAL lcRequestText LOCAL loResp
loReq = CreateObject('Chilkat.HttpRequest') loHttp = CreateObject('Chilkat.Http')
_password = 'komplex' _user = 'alfeus'
lnSuccess = loHttp.UnlockComponent("xxx") IF (lnSuccess <> 1) THEN =MESSAGEBOX(loHttp.LastErrorText) QUIT ENDIF
loReq.HttpVerb = 'PUT' loReq.Charset = "utf-8" loReq.ContentType = "application/json" loReq.SendCharset = 1 loReq.Path = "/api/customer/1857" loReq.AddHeader("Content-Type","application/json")
loHttp.login = _user loHttp.password = _password loHttp.AcceptCharset = "utf-8" loHttp.UserAgent = "" loHttp.AcceptLanguage = "" loHttp.AllowGzip = 0
loHttp.AddQuickHeader("Content-Type","application/json") loHttp.AddQuickHeader("Charset","utf-8") loHttp.Accept = "application/json"
port = 8443 ssl = 1
CLEAR
loResp = loHttp.SynchronousRequest("https://z1.net.e-net.sk",port,ssl,loReq)
IF (loResp = NULL ) THEN ? loHttp.LastErrorText ELSE ? loResp.BodyStr ENDIF
? '' ? '' ?'-----------------------' ?loHttp.LastHeader ?'-----------------------' ?loHttp.LastResponseHeader ?'-----------------------' ?loHttp.LastContentType
1) Please don't post your unlock code.
2) Please enclose code listings within "<pre>" and "<" tags to make them readable.
3) The AddQuickHeader method only applies to other methods where an HttpRequest object is not used, such as in QuickGetStr. Any method, such as SynchronousRequest, where an HTTP request object is explicitly passed, you may add the HTTP header via the HttpRequest.AddHeader method. See http://www.chilkatsoft.com/refdoc/xChilkatHttpRequestRef.html
4) The LastHeader, LastResponseHeader, and LastContentType properties apply to methods where no HTTP response object is returned. For methods such as SynchronousRequest, which return an HTTP response object, you may get this information directly from the HTTP response object. See http://www.chilkatsoft.com/refdoc/xChilkatHttpResponseRef.html The content-type of the response can be obtained via the responseObject.GetHeaderField("Content-Type") method call.