How to debug/display request sent using RestClient

前端 未结 5 1327
执念已碎
执念已碎 2021-02-03 18:37

I am trying to use RestClient to access a webservice using post method. I am sending the authorization token as specified but I am still getting a 403 status error which means I

5条回答
  •  执笔经年
    2021-02-03 19:18

    If you craft a request manually, you can use inspect to show the full url

    req = RestClient::Request.new(
        :method => :post,
        :url => "https://api-dev.xxx.com/software/services/search/ABC",
        headers: {params:{:authorization => "Bearer #{token}"}})
    
    puts req.inspect
    

提交回复
热议问题