Forums

OverviewFelgo 2 Support (Qt 5) › httpRequest Authorization

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #23276

    JESUS

    Hello

    Is there any example with basic header authorization for httpRequest please?

     

    thank you

    #23286

    jrrobles79

    Hi Jesus, I don’t if is correct, but Im doing it like this:

     

       HttpRequest.get(url).set("Authorization",
                                             "Bearer " + token).timeout(
                                maxRequestTimeout).then(function (res) {
                                    //console.debug("api.success")
                                    success(res.body)
                                }).catch(function (err) {
                                    //console.error("api.error:" + JSON.stringify(err))
                                    error(err)
                                })

    I think there is a better example on the documentation

    #23299

    JESUS

    Hi

    thank you for your answer. For me it is working in this way with basic auth:

     

    HttpRequest
                        .get("url")
                        .auth("user", "password")

     

Viewing 3 posts - 1 through 3 (of 3 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support