Extracting binary response from HTTP call within Omnis

TBS andyh at totallybrilliant.com
Mon Nov 7 01:37:53 UTC 2022


Kelly

As ever - simple and to the point :)

Many thanks

Andy Hilton
Totally Brilliant Software Inc
Phone (US) : (863) 409 4870
Phone (UK) : 0207 193 8582
Web : www.totallybrilliant.com
Helpdesk : http://totallybrilliant.kayako.com
Email : andyh at totallybrilliant.com
On Nov 6, 2022, 8:18 PM -0500, Kelly Burgess <kellyb at montana.com>, wrote:
> Hi Andy,
>
> Here's a method that takes a URL and returns the file as a binary. HTTPPage is a stand-alone function, doesn't need a socket, connect, etc.
>
> Kelly
>
>
> No. Parameter Type Subtype Init.Val/Calc Description
> 1 pThumbURL Character 100000000
>
> No. Local Variable Type Subtype Init.Val/Calc Description
> 1 pageBin Binary 100000000
> 2 pageBrk Binary 100000000 binfromhex('0D0A0D0A')
> 3 pos 32 bit integer
> 4 thumbBin Binary 100000000
>
> No. Method text
> 1 ;
> 2 HTTPPage (pThumbURL,443,kFalse) Returns pageBin
> 3 Calculate pos as binsearch(pageBrk,pageBin)
> 4 If pos>0
> 5 Calculate thumbBin as bytemid(pageBin,pos+4,binlength(pageBin)-1)
> 6 Else
> 7 Calculate thumbBin as ''
> 8 End If
> 9 Quit method thumbBin
>
>
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com


More information about the omnisdev-en mailing list