def create_media(media_uri, file_path, content_type, slug=nil)
      file_path = Pathname.new(file_path) unless file_path.is_a?(Pathname)
      stream = file_path.open { |f| f.binmode; f.read }
      service = @service_info.get(media_uri)
      if service.nil?
        raise RequestError, "Service information not found. Get service document before you do create_media."
      end
      unless service.accepts_media_type?(content_type)
        raise RequestError, "Unsupported Media Type: #{content_type}"
      end
      create_resource(media_uri, stream, content_type, slug)
      @res['Location']
    end
def create_media(media_uri, file_path, content_type, slug=nil)
      file_path = Pathname.new(file_path) unless file_path.is_a?(Pathname)
      stream = file_path.open { |f| f.binmode; f.read }
      service = @service_info.get(media_uri)
      if service.nil?
        raise RequestError, "Service information not found. Get service document before you do create_media."
      end
      unless service.accepts_media_type?(content_type)
        raise RequestError, "Unsupported Media Type: #{content_type}"
      end
      create_resource(media_uri, stream, content_type, slug)
      @res['Location']
    end
Create new media resource

 Example:

   media_uri = client.create_media(post_media_uri, 'myimage.jpg', 'image/jpeg')