HTTPGet request – secure requests
Hi Doug, Chris,
Actually, you can. On Windows you can via IE Automation or via Kelly’s TCP Talk.
Here is how I do a getRequest via IE Automation.
Do method —-getRequest (lvURL,cvHeaderList,”,lvUserName,lvPassword,lvResponseText) Returns lvResponseCode
; getRequest Method
If sys(6)=’X’
; Use TCPTalk for Macs
Calculate pvURL as replaceall(pvURL,’ ‘,’%20’) ;; Encode Spaces
Do cvTCPTalk.$doHTTPRequest(‘GET’,pvURL,pvHeaderList,pvXML,pvUserID,pvPassword,pvResponse) Returns responseCode
Else
; Create the IE Object
Do ie6.$createobject()
If ie6.$isavailable
Set reference httpobj to ie6.$ref
Else
Do ie5.$createobject()
If ie5.$isavailable
Set reference httpobj to ie5.$ref
Else
Do ie4.$createobject()
If ie4.$isavailable
Set reference httpobj to ie4.$ref
Else
Do ie3.$createobject()
If ie3.$isavailable
Set reference httpobj to ie3.$ref
Else
Quit method con(jst(statusCode,’-3NP0′),’ ‘,statusDesc)
End If
End If
End If
End If
Do httpobj.$open(‘GET’,pvURL,kFalse)
; Make Headers
Begin reversible block
Set current list pvHeaderList
End reversible block
For each line in list from 1 to #LN step 1
Do httpobj.$setrequestheader(pvHeaderList.c1,pvHeaderList.c2)
End For
Do httpobj.$setrequestheader(‘User-Agent’,’ClienTrax’)
Do httpobj.$setrequestheader(‘Content-Length’,len(pvXML))
Do httpobj.$setrequestheader(‘Cache-Control’,’no-cache,no-store,post-check=0,pre-check=0′)
Do httpobj.$setrequestheader(‘Host’,pvURL)
If pvUserID<>”&pvPassword<>”
; Set Server Authentication
Calculate lvAuth as con(pvUserID,’:’,pvPassword)
UUEncode (lvAuth,lvEncodedAuth)
Do httpobj.$setrequestheader(‘Authorization’,con(‘Basic ‘,lvEncodedAuth))
End If
; Send Request
Do httpobj.$send(pvXML)
; Get Response
Calculate pvResponse as httpobj.$responsetext
Calculate statusDesc as httpobj.$statustext
Calculate statusCode as httpobj.$status
If 1=2
Calculate #S1 as httpobj.$getallresponseheaders
End If
; Give the memory back…
Do httpobj.$release()
Calculate responseCode as con(jst(statusCode,’-3NP0′),’ ‘,statusDesc)
End If
Quit method responseCode
*********************************************************************
Michael Mantkowski
ClienTrax Software
1-614-875-2245
*********************************************************************
—–Original Message—–
From: omnisdev-en [mailto:omnisdev-en-bounces@lists.omnis-dev.com] On Behalf Of Doug Easterbrook
Sent: Friday, December 22, 2017 2:02 PM
To: OmnisDev List – English <omnisdev-en@lists.omnis-dev.com>
Subject: Re: HTTPGet request – secure requests
hi Chris:
you can’t use https with studio 4 — doesn’t work. the feature I think was new to studio 5.
Doug Easterbrook
Arts Management Systems Ltd.
mailto:doug@artsman.com
www.artsman.com
Phone (403) 650-1978
see you at the third annual users conference
tickets.proctors.org/TheatreManager/95/online?performance=29086 <tickets.proctors.org/TheatreManager/95/online?performance=29086>
> On Dec 22, 2017, at 9:34 AM, Chris Webb via omnisdev-en <omnisdev-en@lists.omnis-dev.com> wrote:
>
> Hi All,
> Using Omnis 4.3 (not for much longer though).
> Trying to access a secure url to download a file using the HTTP automation object but are getting an SSL error response.
> So, tried using the HTTPGet request and this returns a HTTP 301 Moved Permanently response. Now I think this is because it is not actually doing a request goes to http and tries to redirect to secure (which it can’t).
> Then added the optional parameters for port (443) and get the response ‘The plain HTTP request was sent to HTTPS port’.
> Then added the parameter for secure as kTrue and it wouldn’t even open a socket.
> Any thoughts on how to get secure request working through HTTPGet?
> Thank in advance.
> Chris
> _____________________________________________________________
> Manage your list subscriptions at lists.omnis-dev.com
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com