login about faq

Calling http.PText('PUT',url,json,'utf-8','application/json',0,0); but received as GET at server. any setting I missed?

ChilkatLog:
  PText:
    DllDate: Mar 20 2017
    ChilkatVersion: 9.5.0.66
    UnlockPrefix: Anything for 30-day trial
    Architecture: Little Endian; 32-bit
    Language: ActiveX
    VerboseLogging: 0
    binaryRequest:
      fullRequest:
        a_synchronousRequest:
          generateRequestHeader:
            httpRequestGenStartLine:
              genStartLine:
                startLine: PUT /rest/vouchers/preRedeemVoucher HTTP/1.1
              --genStartLine
            --httpRequestGenStartLine
            addCookies:
              Not auto-adding cookies.
              sendCookies: 1
              cookieDir: 
            --addCookies
          --generateRequestHeader
          fullHttpRequest:
            domain: kh.payallz.com
            port: 80
            ssl: 0
            openHttpConnection:
              Opening connection directly to HTTP server.
              httpHostname: kh.payallz.com
              httpPort: 80
              ssl: 0
              HTTP connection succeeded.
            --openHttpConnection
            connectTime: Elapsed time: 40 millisec
            sendRequestHeader:
              sendHeaderElapsedMs: 0
            --sendRequestHeader
            sendRequestBody:
              sendBodyElapsedMs: 0
            --sendRequestBody
            statusCode: 301
            statusText: Moved Permanently
          --fullHttpRequest
          getRedirectUrl:
            Location: https://kh.payallz.com/rest/vouchers/preRedeemVoucher
            newLocation:
              url: http://kh.payallz.com/rest/vouchers/preRedeemVoucher
              location: https://kh.payallz.com/rest/vouchers/preRedeemVoucher
              newUrlFinal: https://kh.payallz.com/rest/vouchers/preRedeemVoucher
            --newLocation
          --getRedirectUrl
          redirectCount: 1
          generateRequestHeader:
            httpRequestGenStartLine:
              genStartLine:
                startLine: GET /rest/vouchers/preRedeemVoucher HTTP/1.1
              --genStartLine
            --httpRequestGenStartLine
            addCookies:
              Not auto-adding cookies.
              sendCookies: 1
              cookieDir: 
            --addCookies
          --generateRequestHeader
          fullHttpRequest:
            domain: kh.payallz.com
            port: 443
            ssl: 1
            openHttpConnection:
              Using existing connection.
            --openHttpConnection
            connectTime: Elapsed time: 0 millisec
            sendRequestHeader:
              sendHeaderElapsedMs: 0
            --sendRequestHeader
            statusCode: 403
            statusText: 
          --fullHttpRequest
          success: 1
        --a_synchronousRequest
        success: 1
      --fullRequest
      responseStatus: 403
      Failed.
    --binaryRequest
    Failed.
  --PText
--ChilkatLog

asked Mar 31 at 03:58

SHELYE's gravatar image

SHELYE
1

edited Apr 01 at 16:05

jpbro's gravatar image

jpbro ♦
1.1k2618


I found this is the documentation for the ChilkatHTTP object:

RedirectVerb As String

Indicates the HTTP verb, such as GET, POST, PUT, etc. to be used for a redirect when the FollowRedirects property is set to 1. The default value of this property is "GET". This will produce the same behavior as a web browser (such as FireFox). If this property is set to the empty string, then it will cause the same verb as the original HTTP request to be used.

Note: Prior to version 9.5.0.44, the default value of this property was the empty string.

If you try setting the RedirectVerb property to "" does the call work as expected?

link

answered Apr 01 at 16:09

jpbro's gravatar image

jpbro ♦
1.1k2618

I also notice that the redirect is likely happening because you are first trying to go to an HTTP address, but the system is forcing you over to s lightly different address over HTTPS...you might also want to try going directly to https://kh.payallz.com/rest/vouchers/preRedeemVoucher instead of http://kh.payallz.com/rest/vouchers/preRedeemVoucher to see if that avoids the redirect entirely.

link

answered Apr 01 at 16:18

jpbro's gravatar image

jpbro ♦
1.1k2618

See the online reference documentation for the Http.RedirectVerb property...

link

answered Apr 03 at 21:39

chilkat's gravatar image

chilkat ♦♦
12.8k317366476

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:

×25
×6
×2

Asked: Mar 31 at 03:58

Seen: 347 times

Last updated: Apr 03 at 21:39

powered by OSQA