lib/imgurr/imgurAPI.rb
# Public: Upload an image
#
# args    - The image path for the image to upload
# 
Upload an image
args    - The image path for the image to upload
Upload an image args - The image path for the image to upload
def upload(image_path)
        params   = {:image => File.read(image_path)}
        params[:title] = options[:title] unless options[:title].nil?
        params[:description] = options[:desc] unless options[:desc].nil?
        request  = Net::HTTP::Post.new(API_URI.request_uri + ENDPOINTS[:image])
        request.set_form_data(params)
        request.add_field('Authorization', API_PUBLIC_KEY)
        response = web_client.request(request)
        handle_upload_response(response.body, image_path)
      end
def upload ( image_path ) params = { :image => File . read ( image_path ) } params [ :title ] = options [ :title ] unless options [ :title ] . nil? params [ :description ] = options [ :desc ] unless options [ :desc ] . nil? request = Net :: HTTP :: Post . new ( API_URI . request_uri + ENDPOINTS [ :image ] ) request . set_form_data ( params ) request . add_field ( 'Authorization' , API_PUBLIC_KEY ) response = web_client . request ( request ) handle_upload_response ( response . body , image_path ) end
Public: Upload an image
args    - The image path for the image to upload
Public : Upload an image args - The image path for the image to upload
image_path
<not_specific>