Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I make sense of Ruby documentation?
    primarykey
    data
    text
    <p>I have seen code such as: </p> <pre><code>Net::HTTP::Post.new(url) </code></pre> <p>If I then use <code>ri</code> as follows:</p> <pre><code>$ ri Net::HTTP::Post </code></pre> <p>I get almost no documentation, and:</p> <pre><code>$ ri Net::HTTP::Post.new </code></pre> <p>results in</p> <pre><code>Nothing known about Net::HTTP::Post.new </code></pre> <p>When reading the documentation for <code>Net::HTTP</code>, I get the suspicion that the code should be using <code>Net::HTTP#request_post</code> instead. I still find the correct way to use this module confusing. Why does <code>Net::HTTP::Post.net</code> seem to work? Even with the <code>Net::HTTP.request_post</code>, I get:</p> <pre><code>undefined method `request_post' for Net::HTTP:Class. </code></pre> <p>To clarify my question, what I want is to know how to:</p> <ul> <li>Find the best documentation for ruby.</li> <li>Given the example provided, obtain the best way to achieve the aim (which is, to make an HTTP POST request, I'll add that I need to use provide authentication, cookie, and data in the body).</li> <li>Make sense of what it means when the methods have been annotated with 'R' (does that mean 'read-only'? That doesn't make sense because I need to set the request body, which implies write...</li> </ul> <p>As a contrast, this is equivalent documentation for Python, which I understand (being a python dev myself): <a href="http://docs.python.org/2/library/httplib.html" rel="nofollow">http://docs.python.org/2/library/httplib.html</a></p>
    singulars
    1. This table or related slice is empty.
    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.
 

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