tags:

views:

87

answers:

4

Hi I'm trying to figure out how to upload to imgur using java, does anyone have any experience with this kind of thing?

A: 

You could try cURL. http://curl.haxx.se/libcurl/java/

Ben Shelock
A: 

I've used HtmlUnit with great success for this sort of tasks. Read the Submitting a form in the Getting started section, and you'll be done in no time.

Geo
+2  A: 

First of all, you're likely to be best off using the imgur api.

The documentation for uploading contains examples for Python and PHP that use cURL. It should be possible to adapt these to the Java bindings for cURL, or other HTTP libraries such as HttpClient.

Phil Ross
A: 
  1. Get a developer key.

  2. Look at their Image Upload API.

  3. Use Apache Commons HttpClient to create a POST request and send:

    • 'image' - A binary image file, base64 encoded string, or URL.
    • 'key' - Your registered developer API key. Click here to register for a key.
Pascal Thivent
BalusC