Sample HTTPS Post Using WIN API

Share your advanced PureBasic knowledge/code with the community.
swhite
Enthusiast
Enthusiast
Posts: 727
Joined: Thu May 21, 2009 6:56 pm

Sample HTTPS Post Using WIN API

Post by swhite »

Hi

I have a sample of how to post XML using SSL and the Windows API. It was based on some code I found in the PureArea.net but I thought it might be useful for others wanting to use HTTP post in PB.

Code: Select all

#XMLDeclaration    = "<?xml version="+#DQUOTE$+"1.0"+#DQUOTE$+" encoding="+#DQUOTE$+"UTF-8"+#DQUOTE$+"?>"
#INTERNET_OPEN_TYPE_DIRECT = 1 
#HTTP_ADDREQ_FLAG_ADD = $20000000 
#HTTP_ADDREQ_FLAG_REPLACE = $80000000 
#INTERNET_FLAG_SECURE = $800000  ; https
;#INTERNET_FLAG_SECURE = $0 ; http
#INTERNET_SERVICE_HTTP = 3       ; http
#INTERNET_DEFAULT_HTTPS_PORT = 443 ; https 
;#INTERNET_DEFAULT_HTTPS_PORT = 80 ; http

Procedure SendRequest(*toParam.Param) ; I used a pointer to a structure but you can handle this as you like.
   Define lnOHnd.i,lnCHnd.i,lnRHnd.i,lcHeader.s,lnSHnd.i,lcRxBuf.s,lnRead.i,lnRetVal.i,lcHost.s,lcURL.s
   *toParam\Response = ""
   lnOHnd = InternetOpen_("dCPayment",#INTERNET_OPEN_TYPE_DIRECT,"","",0) ; dCPayment is my user agent you can specify your own
   lcHost = StrExtract(*toParam\Host1,"","/")  ; i.e. no http or https just test.mysite.com
   lcURL = "/"+StrExtract(*toParam\Host1,"/","") ; everything after the .com  i.e. /dev/showage.dcam?
   
   lnCHnd = InternetConnect_(lnOHnd,lcHost,#INTERNET_DEFAULT_HTTPS_PORT,"","",#INTERNET_SERVICE_HTTP,0,0) 
   lnRHnd = HttpOpenRequest_(lnCHnd,"POST",lcURL,"","",0,#INTERNET_FLAG_SECURE,0) 
   lcHeader.s = "Content-Type: text/xml" +Chr(13)+Chr(10)  ; used to post XML and you can added more headers if needed separated by Chr(13)+Chr(10)
   
   HttpAddRequestHeaders_(lnRnd,lcHeader,Len(lcHeader), #HTTP_ADDREQ_FLAG_REPLACE | #HTTP_ADDREQ_FLAG_ADD) ; adds the request headers
   
   *toParam\Request=#XMLDeclaration+*toParam\XMLRoot1+*toParam\Request+*toParam\XMLRoot2 ; the XML string however you define it.
   
   lnSHnd = HttpSendRequest_(lnRHnd,"",0,*toParam\Request,Len(*toParam\Request)) 
   
   lcRxBuf = Space(1024) 
   ; Read until we can't read anymore. The string *toParam\Response will hold what ever we received. 
   Repeat 
      lnRetVal = InternetReadFile_(lnRHnd,@lcRxBuf,1024,@lnRead) 
      *toParam\Response + Left(lcRxBuf,lnRead) 
      
      lcRxBuf = Space(1024) 
   Until (lnRetVal = 1 And lnRead=0 ) Or lnRetVal = 0
   If *toParam\Log ;  This is my logging function but you can handle this anyway you like.
      WriteToLog("REQUEST: https://"+*toParam\Host1+ReplaceString(*toParam\Request,*toParam\Unmasked,*toParam\Masked)+Chr(13)+"RESPONSE: "+*toParam\Response)
   EndIf
EndProcedure  
Simon
Simon White
dCipher Computing
User avatar
Lord
Addict
Addict
Posts: 849
Joined: Tue May 26, 2009 2:11 pm

Re: Sample HTTPS Post Using WIN API

Post by Lord »

Hi!

In which version of PureBasic was "StrExtract()" introduced?
Image
User avatar
Bisonte
Addict
Addict
Posts: 1232
Joined: Tue Oct 09, 2007 2:15 am

Re: Sample HTTPS Post Using WIN API

Post by Bisonte »

In none in the past ;)

But you can use GetUrlPart() instead, if I understand the comments in the right way.
PureBasic 6.10 LTS (Windows x86/x64) | Windows10 Pro x64 | Asus TUF X570 Gaming Plus | R9 5900X | 64GB RAM | GeForce RTX 3080 TI iChill X4 | HAF XF Evo | build by vannicom​​
English is not my native language... (I often use DeepL to translate my texts.)
swhite
Enthusiast
Enthusiast
Posts: 727
Joined: Thu May 21, 2009 6:56 pm

Re: Sample HTTPS Post Using WIN API

Post by swhite »

Lord wrote:Hi!

In which version of PureBasic was "StrExtract()" introduced?
Sorry I forgot I used a custom function I created a long time ago.

Code: Select all

Procedure.s StrExtract(tcString.s,tcDelim1.s,tcDelim2.s,tnOccurance=1,tnMode=#PB_String_NoCase)
   Define ln1.i=0,ln2.i=0,ln.i=0,lnDelim.i=Len(tcDelim1)
   Repeat
      If tcDelim1 = ""
         ln1 = 1
      Else
         ln1=FindString(tcString,tcDelim1,1,tnMode)
      EndIf
      If tcDelim2 = ""
         ln2 = Len(tcString)+1
      Else
         ln2=FindString(tcString,tcDelim2,ln1+lnDelim,tnMode)
      EndIf
      
      ln=ln+1
      If ln1 > 0 And ln < tnOccurance
         tcString=Mid(tcString,ln1+lnDelim)
      EndIf
   Until ln=tnOccurance Or ln1=0
   If ln1 > 0 And ln2 > ln1
      ProcedureReturn Mid(tcString,ln1+lnDelim,ln2-ln1-lnDelim)
   ElseIf ln1 > 0
      ProcedureReturn Mid(tcString,ln1+lnDelim,Len(tcString)-ln1-lnDelim)
   Else
      ProcedureReturn ""
   EndIf
EndProcedure
Simon White
dCipher Computing
swhite
Enthusiast
Enthusiast
Posts: 727
Joined: Thu May 21, 2009 6:56 pm

Re: Sample HTTPS Post Using WIN API

Post by swhite »

Bisonte wrote:In none in the past ;)

But you can use GetUrlPart() instead, if I understand the comments in the right way.
GetURLPart() would work just fine and thanks for the tip. I created the StrExtract function years ago and never thought to look for a built in function to do the same.

Simon
Simon White
dCipher Computing
User avatar
Lord
Addict
Addict
Posts: 849
Joined: Tue May 26, 2009 2:11 pm

Re: Sample HTTPS Post Using WIN API

Post by Lord »

swhite wrote:
Lord wrote:Hi!

In which version of PureBasic was "StrExtract()" introduced?
Sorry I forgot I used a custom function I created a long time ago.

...
Thanks for clarification. :wink:
Image
swhite
Enthusiast
Enthusiast
Posts: 727
Joined: Thu May 21, 2009 6:56 pm

Re: Sample HTTPS Post Using WIN API

Post by swhite »

Here is an updated version with some error checking and using PB's GetURLPart() function

Code: Select all

Procedure SendRequest(*toParam.Param) ; I used a pointer to a structure but you can handle this as you like.
   Define lnOHnd.i,lnCHnd.i,lnRHnd.i,lcHeader.s,lnSHnd.i,lcRxBuf.s,lnRead.i,lnRetVal.i,lcHost.s,lcURL.s
   *toParam\Response = ""
   lnOHnd = InternetOpen_("dCPayment",#INTERNET_OPEN_TYPE_DIRECT,"","",0) ; dCPayment is my user agent you can specify your own
   If lnOHnd
      
      lcHost = GetURLPart("https://"+*toParam\Host1,#PB_URL_Site) ; GetURLPart requires the protocol to work correctly which is not part *toParam\Host1
      lcURL = "/"+GetURLPart("https://"+*toParam\Host1,#PB_URL_Path)
      
      lnCHnd = InternetConnect_(lnOHnd,lcHost,#INTERNET_DEFAULT_HTTPS_PORT,"","",#INTERNET_SERVICE_HTTP,0,0)
      If lnCHnd
         lnRHnd = HttpOpenRequest_(lnCHnd,"POST",lcURL,"","",0,#INTERNET_FLAG_SECURE,0) 
         If lnRHnd 
            lcHeader.s = "Content-Type: text/xml" +Chr(13)+Chr(10)  ; used to post XML and you can added more headers if needed separated by Chr(13)+Chr(10)
            
            HttpAddRequestHeaders_(lnRnd,lcHeader,Len(lcHeader), #HTTP_ADDREQ_FLAG_REPLACE | #HTTP_ADDREQ_FLAG_ADD) ; adds the request headers
            
            *toParam\Request=#XMLDeclaration+*toParam\XMLRoot1+*toParam\Request+*toParam\XMLRoot2 ; the XML string however you define it.
            
            lnSHnd = HttpSendRequest_(lnRHnd,"",0,*toParam\Request,Len(*toParam\Request)) 
            WriteTolog(Str(lnSHnd))
            
            lcRxBuf = Space(1024) 
            ; Read until we can't read anymore. The string *toParam\Response will hold what ever we received.
            Repeat 
               lnRetVal = InternetReadFile_(lnRHnd,@lcRxBuf,1024,@lnRead) 
               
               *toParam\Response + Left(lcRxBuf,lnRead) 
               
               lcRxBuf = Space(1024) 
            Until (lnRetVal = 1 And lnRead=0 ) Or lnRetVal = 0
            
            If *toParam\Log ;  This is my logging function but you can handle this anyway you like.
               WriteToLog("REQUEST: https://"+*toParam\Host1+ReplaceString(*toParam\Request,*toParam\Unmasked,*toParam\Masked)+Chr(13)+"RESPONSE: "+*toParam\Response)
            EndIf
         Else
            WriteToLog("HttpOpenRequest_() failed.")
         EndIf
      Else
         WriteToLog("InternetConnect_() failed.")
      EndIf
   Else
      WriteToLog("InternetOpen_() failed.")
   EndIf
EndProcedure  
Simon White
dCipher Computing
User avatar
RichAlgeni
Addict
Addict
Posts: 914
Joined: Wed Sep 22, 2010 1:50 am
Location: Bradenton, FL

Re: Sample HTTPS Post Using WIN API

Post by RichAlgeni »

I've taken the liberty of turning Simon's program into a small standalone process.

I have changed variable names to better reflect my coding style. But all credit should go to Simon for his concept.

Code: Select all

EnableExplicit

#HTTP_ADDREQ_FLAG_REPLACE = $80000000
#HTTP_ADDREQ_FLAG_ADD     = $20000000

OpenConsole()

Define httpHandle.i, httpSession.i, requestHandle.i, receiveBuffer.s, readLength.i
Define responseText.s, returnValue.i, webServer.s, httpPath.s

httpHandle = InternetOpen_("Testing", #INTERNET_OPEN_TYPE_DIRECT, "", "", 0)
If httpHandle
    webServer = "maps.googleapis.com"
    httpPath  = "maps/api/geocode/xml?address=Empire+State+Building"

; https://maps.googleapis.com/maps/api/geocode/xml?address=Empire+State+Building

    httpSession = InternetConnect_(httpHandle, webServer, #INTERNET_DEFAULT_HTTPS_PORT, "", "", #INTERNET_SERVICE_HTTP, 0, 0)
    If httpSession
        requestHandle = HttpOpenRequest_(httpSession, "GET", httpPath, "", "", 0, #INTERNET_FLAG_SECURE, 0)
        If requestHandle
            If HttpSendRequest_(requestHandle, "", 0, "", 0)
                Repeat
                   receiveBuffer = Space(4096)
                   returnValue   = InternetReadFile_(requestHandle, @receiveBuffer, 4096, @readLength)
                   responseText  + Left(receiveBuffer, readLength)
                Until (returnValue = 1 And readLength = 0) Or returnValue = 0

                PrintN("https://" + webServer+ "/" + httpPath)
                PrintN("")
                PrintN(responseText)
            Else
                PrintN("HttpSendRequest_() failed.")
            EndIf
        Else
            PrintN("HttpOpenRequest_() failed.")
        EndIf
    Else
        PrintN("InternetConnect_() failed.")
    EndIf
Else
    PrintN("InternetOpen_() failed.")
EndIf

Input()
CloseConsole()

End
; IDE Options = PureBasic 5.45 LTS (Windows - x64)
; CursorPosition = 5
; DisableDebugger
This should duplicate the functionality of launching a browser to https://maps.googleapis.com/maps/api/ge ... e+Building
QuimV
Enthusiast
Enthusiast
Posts: 337
Joined: Mon May 29, 2006 11:29 am
Location: BARCELONA - SPAIN

Re: Sample HTTPS Post Using WIN API

Post by QuimV »

I have n error about structure Param not found.
How is this structure?
Thanks
QuimV
User avatar
RichAlgeni
Addict
Addict
Posts: 914
Joined: Wed Sep 22, 2010 1:50 am
Location: Bradenton, FL

Re: Sample HTTPS Post Using WIN API

Post by RichAlgeni »

QuimV wrote:I have n error about structure Param not found.
How is this structure?
Thanks
The structure used by Simon is defined in one of his base routines. Try using the process I posted above, it does not use the structure.
User avatar
RichAlgeni
Addict
Addict
Posts: 914
Joined: Wed Sep 22, 2010 1:50 am
Location: Bradenton, FL

Re: Sample HTTPS Post Using WIN API

Post by RichAlgeni »

New version, with the header returned, and handles closed.

Code: Select all

EnableExplicit

; see https://msdn.microsoft.com/en-us/library/windows/desktop/aa384322(v=vs.85).aspx

#HTTP_QUERY_CONTENT_LENGTH   = 5
#HTTP_QUERY_RAW_HEADERS_CRLF = 22
#HTTP_ADDREQ_FLAG_REPLACE    = $80000000
#HTTP_ADDREQ_FLAG_ADD        = $20000000
#INTERNET_ERROR_BASE         = 12000
#ERROR_HTTP_HEADER_NOT_FOUND = #INTERNET_ERROR_BASE + 150

OpenConsole()

Define internetHandle.i, sessionHandle.i, requestHandle.i, contentType.s, amountRead.i, headerIndex.i
Define responseText.s, returnValue.i, webServer.s, httpPath.s, errorNumber.i, requestResponse.i
Define readLength.i = 4096
Define *receiveBuffer
*receiveBuffer = AllocateMemory(readLength + 1)

internetHandle = InternetOpen_(#Null, #INTERNET_OPEN_TYPE_DIRECT, "", "", 0)
If internetHandle
    webServer = "maps.googleapis.com"
    httpPath  = "maps/api/geocode/json?address=Empire+State+Building"
; https://maps.googleapis.com/maps/api/geocode/json?address=Empire+State+Building

    sessionHandle = InternetConnect_(internetHandle, webServer, #INTERNET_DEFAULT_HTTPS_PORT, "", "", #INTERNET_SERVICE_HTTP, 0, 0)
    If sessionHandle
        requestHandle = HttpOpenRequest_(sessionHandle, "GET", httpPath, "", "", 0, #INTERNET_FLAG_SECURE, 0)
        If requestHandle
            PrintN("https://" + webServer+ "/" + httpPath)

            contentType = "Content-Type: text/plain" + #CRLF$
            If HttpAddRequestHeaders_(requestHandle, contentType, Len(contentType), #HTTP_ADDREQ_FLAG_REPLACE | #HTTP_ADDREQ_FLAG_ADD)
                PrintN("------------------ Header Added -----------------")
                PrintN(contentType)
                PrintN("---------------- End Header Added ---------------")
            Else
                PrintN("HttpAddRequestHeaders_() failed.")
            EndIf

            requestResponse = HttpSendRequest_(requestHandle, "", 0, "", 0)
            If requestResponse
                amountRead = readLength
                If HttpQueryInfo_(requestHandle, #HTTP_QUERY_RAW_HEADERS_CRLF, *receiveBuffer, @amountRead, @headerIndex)
                    PrintN("---------------- Header Received ----------------")
                    PrintN(PeekS(*receiveBuffer, amountRead))
                    PrintN("-------------- End Header Received --------------")
                Else
                    errorNumber = GetLastError_()
                    Select errorNumber
                    Case #ERROR_HTTP_HEADER_NOT_FOUND
                        PrintN("HttpQueryInfo_() #ERROR_HTTP_HEADER_NOT_FOUND.")
                    Default
                        PrintN("HttpQueryInfo_() failed, errorNumber = " + Str(errorNumber))
                    EndSelect
                EndIf

                Repeat
                    returnValue   = InternetReadFile_(requestHandle, *receiveBuffer, readLength, @amountRead)
                    responseText  + PeekS(*receiveBuffer, amountRead)
                Until (returnValue = 1 And amountRead = 0) Or returnValue = 0

                PrintN("--------------- Response Received ---------------")
                PrintN(responseText)
                PrintN("------------- End Response Received -------------")
                returnValue = InternetCloseHandle_(sessionHandle)
                PrintN("InternetCloseHandle_(sessionHandle) = " + Str(returnValue))
                returnValue = InternetCloseHandle_(internetHandle)
                PrintN("InternetCloseHandle_(internetHandle) = " + Str(returnValue))
            Else
                PrintN("HttpSendRequest_() failed.")
            EndIf
        Else
            PrintN("HttpOpenRequest_() failed.")
        EndIf
    Else
        PrintN("InternetConnect_() failed.")
    EndIf
Else
    PrintN("InternetOpen_() failed.")
EndIf

Input()
CloseConsole()

End
The output you should receive:

Code: Select all

https://maps.googleapis.com/maps/api/geocode/json?address=Empire+State+Building
------------------ Header Added -----------------
Content-Type: text/plain

---------------- End Header Added ---------------
---------------- Header Received ----------------
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Access-Control-Allow-Origin: *
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Alt-Svc: hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337; quic=51303335,quic=":443"; ma=2592000; v="41,39,38,37,35"
Vary: Accept-Language,Accept-Encoding
Transfer-Encoding: chunked
Expires: Mon, 18 Dec 2017 20:17:24 GMT


-------------- End Header Received --------------
--------------- Response Received ---------------
{
   "results" : [
      {
         "address_components" : [
            {
               "long_name" : "350",
               "short_name" : "350",
               "types" : [ "street_number" ]
            },
            {
               "long_name" : "5th Avenue",
               "short_name" : "5th Ave",
               "types" : [ "route" ]
            },
            {
               "long_name" : "Manhattan",
               "short_name" : "Manhattan",
               "types" : [ "political", "sublocality", "sublocality_level_1" ]
            },
            {
               "long_name" : "New York",
               "short_name" : "New York",
               "types" : [ "locality", "political" ]
            },
            {
               "long_name" : "New York County",
               "short_name" : "New York County",
               "types" : [ "administrative_area_level_2", "political" ]
            },
            {
               "long_name" : "New York",
               "short_name" : "NY",
               "types" : [ "administrative_area_level_1", "political" ]
            },
            {
               "long_name" : "United States",
               "short_name" : "US",
               "types" : [ "country", "political" ]
            },
            {
               "long_name" : "10118",
               "short_name" : "10118",
               "types" : [ "postal_code" ]
            }
         ],
         "formatted_address" : "350 5th Ave, New York, NY 10118, USA",
         "geometry" : {
            "location" : {
               "lat" : 40.7484405,
               "lng" : -73.98566439999999
            },
            "location_type" : "ROOFTOP",
            "viewport" : {
               "northeast" : {
                  "lat" : 40.7497894802915,
                  "lng" : -73.98431541970848
               },
               "southwest" : {
                  "lat" : 40.7470915197085,
                  "lng" : -73.98701338029149
               }
            }
         },
         "place_id" : "ChIJaXQRs6lZwokRY6EFpJnhNNE",
         "types" : [ "establishment", "point_of_interest" ]
      }
   ],
   "status" : "OK"
}

------------- End Response Received -------------
InternetCloseHandle_(sessionHandle) = 1
InternetCloseHandle_(internetHandle) = 1
QuimV
Enthusiast
Enthusiast
Posts: 337
Joined: Mon May 29, 2006 11:29 am
Location: BARCELONA - SPAIN

Re: Sample HTTPS Post Using WIN API

Post by QuimV »

With PB 5.61 I receive this:

Code: Select all

https://maps.googleapis.com/maps/api/geocode/json?address=Empire+State+Building
------------------ Header Added -----------------
Content-Type: text/plain

---------------- End Header Added ---------------
---------------- Header Received ----------------
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Date: Mon, 18 Dec 2017 06:36:53 GMT
Expires: Tue, 19 Dec 2017 06:36:53 GMT
Cache-Control: public, max-age=86400
Access-Control-Allow-Origin: *
Server: mafe
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Alt-Svc: hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; qui
c=51303337; quic=51303335,quic=":443"; ma=2592000; v="41,39,38,37,35"
Accept-Ranges: none
Vary: Accept-Language,Accept-Encoding
Transfer-Encoding: chunked


-------------- End Header Received --------------
--------------- Response Received ---------------
?┼????????┼┼??┼┼┼┼?????????????┼┼┼┼┼??┼┼┼┼┼┼┼?????>????┼┼┼┼┼┼┼?????=?????┼┼┼┼┼┼┼
????????????????┼┼┼┼┼??┼┼┼┼┼┼?┼┼┼┼┼┼┼?????=?????????┼┼┼┼┼┼┼?????=?????=?┼┼┼┼┼┼┼?
????????=??┼┼┼┼┼??┼┼┼┼┼┼?┼┼┼┼┼┼┼?????=????????┼┼┼┼┼┼┼??????>???????┼┼┼┼┼┼┼???>??
????????????????????????┼┼┼┼┼┼??┼┼┼┼┼??┼┼┼┼┼┼┼?????>????»?┼┼┼┼┼┼┼??????>????»?┼┼
┼┼┼┼┼????????????????????┼┼┼┼┼??┼┼┼┼┼┼?┼┼┼┼┼┼┼?????=???7???????┼┼┼┼┼┼┼??????>???
???????┼┼┼┼┼┼┼???>??8,37,35"
Accept-Ranges: none
Vary: Accept-Language,Accept-Encoding
Transfer-Encoding: chunked

??????????????????????┼┼┼┼┼??┼┼┼┼┼┼?┼┼┼┼┼┼┼?????=???7????┼┼┼┼┼┼┼?????=?????┼┼┼┼┼
┼┼???>????????????????????????┼┼┼┼┼??┼┼┼┼┼┼?┼┼┼┼┼┼┼?????=??????????┼┼┼┼┼┼┼??????
>???┼┼┼┼┼┼┼??????????????????┼┼┼┼┼┼??┼┼┼┼┼??┼┼┼┼┼┼┼?????>?????┼┼┼┼┼┼┼?????=?????
?┼┼┼┼┼┼┼????????????=??┼┼┼┼┼??┼┼┼┼??┼┼┼┼?????????>????????7???????????┼┼┼┼?????>
?┼┼┼┼┼┼????????┼┼┼┼┼┼┼??>??????┼┼┼┼┼┼┼??????????????┼┼┼┼┼┼??┼┼┼┼┼???????=???????
┼┼┼┼┼┼????????┼┼┼┼┼┼┼?????>?┼┼┼┼┼┼┼┼┼??>?????????┼┼┼┼┼┼┼┼┼??>??????????┼┼┼┼┼┼┼??
┼┼┼┼┼┼┼?????>?┼┼┼┼┼┼┼┼┼??>?????????┼┼┼┼┼┼┼┼┼??>??????????┼┼┼┼┼┼┼?┼┼┼┼┼┼?┼┼┼┼??┼┼
┼┼?????>????????????????┼┼┼┼???>?????????????????????┼┼??┼??┼???????????????????
?????????????????????>??????????????????????????????????????????????????????????
??????????????????????????????????????????????????????????
------------- End Response Received -------------
InternetCloseHandle_(sessionHandle) = 1
InternetCloseHandle_(internetHandle) = 1
QuimV
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: Sample HTTPS Post Using WIN API

Post by srod »

Add the #PB_Ascii flag to the PeekS() statements.

A nice example. Thanks.
I may look like a mule, but I'm not a complete ass.
QuimV
Enthusiast
Enthusiast
Posts: 337
Joined: Mon May 29, 2006 11:29 am
Location: BARCELONA - SPAIN

Re: Sample HTTPS Post Using WIN API

Post by QuimV »

:D Thanks Srod. I work with #PB_UTF8 and it works fine too.
BTW: Topic Title says "HTTPS Post", but code is for HTTPS Get?
QuimV
User avatar
RichAlgeni
Addict
Addict
Posts: 914
Joined: Wed Sep 22, 2010 1:50 am
Location: Bradenton, FL

Re: Sample HTTPS Post Using WIN API

Post by RichAlgeni »

QuimV wrote::D Thanks Srod. I work with #PB_UTF8 and it works fine too.
BTW: Topic Title says "HTTPS Post", but code is for HTTPS Get?
I didn't have a site where I could do a post, so I made the program use GET.
Post Reply