title: Rails: How to get a http request with header? (Product Hunt API)
body: <p>I'm trying to use <code>Product Hunt</code>'s API to get its daily posts.
  This is what I endup with</p>
  
  <pre><code>task :fetch_product_hunt =&gt; :environment  do
    query = "http://api.producthunt.com/v1/posts"
    access_token = `My API Key`
    response = HTTParty.get(query,
                            :headers =&gt; {'Accept' =&gt; 'application/json',
                                         'Content-Type' =&gt; 'application/json',
                                         'Authorization' =&gt; access_token,
                                         'Host' =&gt; 'api.producthunt.com'}).body
    decode_response =  ActiveSupport::JSON.decode(response)
    puts decode_response
  end
  </code></pre>
  
  <p>The problem is that I don't know how to specify the <code>header</code> for the <code>get http request</code>. And I'm getting <code>{"status"=&gt;"404", "error"=&gt;"Not Found"}</code>.</p>
  
  <p>The docs are here: <a href="https://api.producthunt.com/v1/docs/posts/posts_index_get_the_posts_of_today" rel="nofollow">https://api.producthunt.com/v1/docs/posts/posts_index_get_the_posts_of_today</a></p>