dominic
dominic

Reputation: 468

Upload to imgur java

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

Upvotes: 5

Views: 6393

Answers (4)

Pascal Thivent
Pascal Thivent

Reputation: 570325

  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.

Upvotes: 5

Phil Ross
Phil Ross

Reputation: 26090

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.

Upvotes: 6

Geo
Geo

Reputation: 96787

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.

Upvotes: 0

Ben Shelock
Ben Shelock

Reputation: 20965

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

Upvotes: 0

Related Questions