Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - plokij909

Pages: [1]
1
REST / HTTP / HTTPS / Re: Request/retrieve post data from a webhook
« on: April 10, 2018, 08:17:10 PM »
Here's the code to use if anyone else is having troubles.


If Request.TotalBytes > 0 Then
  Dim lngBytesCount
  lngBytesCount = Request.TotalBytes
  jsonstring = BytesToStr(Request.BinaryRead(lngBytesCount))
End If

    Function BytesToStr(bytes)
        Dim Stream
        Set Stream = Server.CreateObject("Adodb.Stream")
            Stream.Type = 1 'adTypeBinary
            Stream.Open
            Stream.Write bytes
            Stream.Position = 0
            Stream.Type = 2 'adTypeText
            Stream.Charset = "iso-8859-1"
            BytesToStr = Stream.ReadText
            Stream.Close
        Set Stream = Nothing
    End Function

2
REST / HTTP / HTTPS / Re: S3 UploadBytes throwing error
« on: April 08, 2018, 07:23:11 AM »
That worked! Thank you!

3
REST / HTTP / HTTPS / S3 UploadBytes throwing error
« on: April 06, 2018, 11:52:20 PM »
Hi - I've just updated my ChilkatDLL and I'm now getting an error when using s3_uploadByes - "Bad Request" - did something change in the function call?

binaryRequestX:
        binaryRequest:
          fullRequest:
            a_synchronousRequest:
              generateRequestHeader:
                httpRequestGenStartLine:
                  genStartLine:
                    startLine: PUT /xxx/xxxx.jpg HTTP/1.1
                  --genStartLine
                --httpRequestGenStartLine
                addCookies:
                  Not auto-adding cookies.
                  sendCookies: 1
                  cookieDir:
                --addCookies
              --generateRequestHeader
              fullHttpRequest:
                domain: files.xxxx.com.s3-ap-southeast-2.amazonaws.com
                port: 443
                ssl: 1
                openHttpConnection:
                  Opening connection directly to HTTP server.
                  httpHostname: files.xxxx.com.s3-ap-southeast-2.amazonaws.com
                  httpPort: 443
                  tls: 1
                  HTTPS secure channel established.
                --openHttpConnection
                connectTime: Elapsed time: 670 millisec
                sendRequestHeader:
                  sendHeaderElapsedMs: 0
                --sendRequestHeader
                sendRequestBody:
                  sendBodyElapsedMs: 0
                --sendRequestBody
                statusCode: 400
                statusText: Bad Request

                checkCloseConnection:
                  Response includes connection:close header (or proxy-connection:close header)
                --checkCloseConnection
              --fullHttpRequest
              success: 1
            --a_synchronousRequest
            success: 1
          --fullRequest
          responseStatus: 400
          Failed.
        --binaryRequest
      --binaryRequestX
      responseBody:
    --s3__uploadData
    Failed.
  --S3_UploadBytes
--ChilkatLog

4
REST / HTTP / HTTPS / Re: Request/retrieve post data from a webhook
« on: April 06, 2018, 11:49:39 PM »
Hi,

I've tried looping through request.form - it doesn't work (it's blank). I've seen people using Request.BinaryRead, e.g. https://stackoverflow.com/questions/25991314/mailgun-webhooks-and-classic-asp

5
REST / HTTP / HTTPS / Request/retrieve post data from a webhook
« on: April 06, 2018, 02:22:39 AM »
Hi, I'm trying to use Stripe's WebHooks with Classic ASP and can't retrieve their POST JSON data when it hits my page.

Normal request.form() doesn't work. I've read there are ways to do it with BinaryRead.

Is there a better way using a Chilkat Library (would be great if Chilkat could add a WebHook example in the Stripe example page: http://rest-examples.chilkat.io/stripe/asp/default.cshtml)

Thanks

Pages: [1]