login about faq

*VFP 9 SP2

  • why cannot find a content-type supported by your client ?
  • chikat version 9.3.2
    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
    

asked Sep 26 '12 at 10:36

kofo's gravatar image

kofo
1223


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.

link

answered Sep 26 '12 at 11:33

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×186

Asked: Sep 26 '12 at 10:36

Seen: 1,352 times

Last updated: Sep 26 '12 at 14:54

powered by OSQA