Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you use Net::HTTP instead of rest-client, you can use <code>http.set_debug_output $stderr</code> to see the contents of the request and response:</p> <pre><code>require 'net/http' require 'openssl' uri = URI('https://myserverip/myuri') http = Net::HTTP.new(uri.host, uri.port) http.set_debug_output $stderr http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(uri.request_uri) request.basic_auth 'username', 'password' response = http.request(request) @data = response.body puts response.body </code></pre> <p>In addition, using Net::HTTP, I can also get it to <a href="https://stackoverflow.com/questions/5140132/if-using-ruby-with-net-http-how-to-monitor-its-traffic-using-fiddler-on-windows">use a proxy</a> by using something like <code>http = Net::HTTP::Proxy('127.0.0.1','8888').new(uri.host, uri.port)</code>. </p> <p>You can also do the same with rest-client by using <code>RestClient.proxy = "http://127.0.0.1:8888/"</code> just before your <code>RestClient.get(url)</code> etc..</p> <p>This way I can send the traffic via a tool like <a href="http://fiddler2.com/" rel="nofollow noreferrer">Fiddler2</a> on Windows and then see all the detail I need.</p> <p>It's just a shame I can't find an equivalent to Fiddler for the Mac since that's where I want to write the code. </p> <p>It Looks like I'll either have to rewrite my code to use HTTP::Net instead of rest-client, or switch to Windows full time ;), unless anyone has any other thoughts. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload