def self.upload_photo()
path = File.join(RAILS_ROOT, 'test/fixtures/photos/p1.jpg')
file = File.open(path)
result = post('/photos', :body => {:format=>'json', :photo =>
{:data => file})
file.close
return result
end
this doesn't seem to work.
Thanks,
Kai
--
You received this message because you are subscribed to the Google Groups "HTTParty Gem" group.
To post to this group, send email to httpar...@googlegroups.com.
To unsubscribe from this group, send email to httparty-gem...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/httparty-gem?hl=en.
Like Jon said, HTTParty doesn't support files. You'll have to read the
file as a string first. Try something like this:
def self.upload_photo()
path = File.join(RAILS_ROOT, 'test/fixtures/photos/p1.jpg')
file = File.read( path )
post('/photos', :body => {:format=>'json', :photo => {:data =>
file})
end
pete