lib/httpclient.rb
# Posts a content.
#
# uri:: a String or an URI object which represents an URL of web resource.
# body:: a Hash or an Array of body part. e.g.
#          { "a" => "b" } => 'a=b'
#        Give an array to pass multiple value like
#          [["a", "b"], ["a", "c"]] => 'a=b&a=c'
#        When you pass a File as a value, it will be posted as a
#        multipart/form-data.  e.g.
#          { 'upload' => file }
#        You can also send custom multipart by passing an array of hashes.
#        Each part must have a :content attribute which can be a file, all
#        other keys will become headers.
#          [{ 'Content-Type' => 'text/plain', :content => "some text" },
#           { 'Content-Type' => 'video/mp4', :content => File.new('video.mp4') }]
#          => <Two parts with custom Content-Type header>
# header:: a Hash or an Array of extra headers. e.g.
#            { 'Accept' => 'text/html' }
#          or
#            [['Accept', 'image/jpeg'], ['Accept', 'image/png']].
# &block:: Give a block to get chunked message-body of response like
#            post_content(uri) { |chunked_body| ... }.
#          Size of each chunk may not be the same.
#
# post_content follows HTTP redirect status (see HTTP::Status.redirect?)
# internally and try to post the content to redirected URL.  See
# redirect_uri_callback= how HTTP redirection is handled.
# Bear in mind that you should not depend on post_content because it sends
# the same POST method to the new location which is prohibited in HTTP spec.
#
# If you need to get full HTTP response including HTTP status and headers,
# use post method.
Posts a content.
uri:: a String or an URI object which represents an URL of web resource.
body:: a Hash or an Array of body part.

post_content follows HTTP redirect status
internally and try to post the content to redirected URL.  See
redirect_uri_callback= how HTTP redirection is handled.
Bear in mind that you should not depend on post_content because it sends
the same POST method to the new location which is prohibited in HTTP spec.

If you need to get full HTTP response including HTTP status and headers,
use post method.
Posts a content . uri :: a String or an URI object which represents an URL of web resource . body :: a Hash or an Array of body part . post_content follows HTTP redirect status internally and try to post the content to redirected URL . See redirect_uri_callback = how HTTP redirection is handled . Bear in mind that you should not depend on post_content because it sends the same POST method to the new location which is prohibited in HTTP spec . If you need to get full HTTP response including HTTP status and headers use post method .
def post_content(uri, *args, &block)
    if hashy_argument_has_keys(args, :query, :body)
      query, body, header = keyword_argument(args, :query, :body, :header)
    else
      query = nil
      body, header = keyword_argument(args, :body, :header)
    end
    success_content(follow_redirect(:post, uri, query, body, header || {}, &block))
  end
def post_content ( uri , * args , & block ) if hashy_argument_has_keys ( args , :query , :body ) query , body , header = keyword_argument ( args , :query , :body , :header ) else query = nil body , header = keyword_argument ( args , :body , :header ) end success_content ( follow_redirect ( :post , uri , query , body , header || { } , & block ) ) end
Posts a content.
Posts a content .
uri
<not_specific>
args
<not_specific>
block
<not_specific>