Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

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.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded