Module: LinkedinV2::Api::Medias

Included in:
Client
Defined in:
lib/linkedin_v2/api/medias.rb

Instance Method Summary collapse

Instance Method Details

#upload_image(picture_url:) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/linkedin_v2/api/medias.rb', line 4

def upload_image(picture_url:)
  file = Files::Creator.(picture_url)
  body = { file: file }
  path = LinkedinV2::Url::Builder.(:upload_image)

  request(:post, path, body, {}, API_V1_URL)
ensure
  Files::Destroyer.(file)
end