How to debug/display request sent using RestClient

前端 未结 5 1334
执念已碎
执念已碎 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:14

    You could try enabling RestClient's logging and see whether this provides any useful output:

    RESTCLIENT_LOG=stdout path/to/my/program
    

    or if you are using Rails

    RESTCLIENT_LOG=stdout bundle exec passenger
    

    replacing passenger with your choice of server. This will redirect all logging to standard output (your console).

    Personally I prefer using more verbose tools when I need to inspect or troubleshoot HTTP requests.

    You could try curl or wget if you prefer command-line, or one of the many browser extensions which let you perform requests easily, inspect output, save for future use, set up different environments etc. Both Postman and Advanced REST Client are good choices.

提交回复
热议问题