views:

221

answers:

1

Hi dudes!

I just recieve my unique developer API key from Imgur and I'm aching to start cracking on this baby.

First a simple test to kick things off. How can I upload an image using C#? I found this using Python:

#!/usr/bin/python

import pycurl

c = pycurl.Curl()
values = [
          ("key", "YOUR_API_KEY"),
          ("image", (c.FORM_FILE, "file.png"))]
# OR:     ("image", "http://example.com/example.jpg"))]
# OR:     ("image", "BASE64_ENCODED_STRING"))]

c.setopt(c.URL, "http://imgur.com/api/upload.xml")
c.setopt(c.HTTPPOST, values)

c.perform()
c.close()
+3  A: 

looks like the site uses HTTP Post to upload images. Take a look at the HTTPWebRequest class and using it to POST to a URL: Posting data with HTTPRequest.

GrayWizardx
You sir are a gentleman and a scholar. Thanks a bunch. :3
Sergio Tapia