[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

call WebApi requiring API token authorisation


call WebApi requiring API token authorisation

What's the best way to code calling a WebApi requiring an API "BEARER" token embedded in a header?

A quick google initially suggested using Curl but on
    Debian 12 bookworm
    Gambas 3.18.0 from the Debian repository for above
    installed gambas3-gb-net-curl from Debian repository
    Start new command line project
    add gb.net.curl component
    Dim myCurl as Curl
etc ...

but F8 fails on first line with
    Class 'Curl' is not creatable (Main:5)

On same unit, I can from terminal run Curl command with parameters and all works fine.

Is there another component or step to allow this to work in Gambas?

or

should I be using httpclient now?

If the latter is there good example to follow?

K