We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The library currently encodes the image inline as base64 in the post data. It would be better to send a multipart/related request instead.
One way to do it would be to add an upload method, eg:
module Openphoto require 'net/http/post/multipart' class Client def upload photo, params = {} params["photo"] = UploadIO.new(File.open(photo), "image/jpeg", File.basename(photo)) access_token = prepare_access_token request = Net::HTTP::Post::Multipart.new('/photo/upload.json', params) access_token.sign! request url = URI.parse @hostname response = Net::HTTP.start(url.host, url.port, :use_ssl => true) do |http| http.request request end response.extend Openphoto::Response response end end end
(used in https://github.com/jo/trovebox-uploader)
One could also enhance the connect method.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The library currently encodes the image inline as base64 in the post data.
It would be better to send a multipart/related request instead.
One way to do it would be to add an upload method, eg:
(used in https://github.com/jo/trovebox-uploader)
One could also enhance the connect method.
The text was updated successfully, but these errors were encountered: