Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7693815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:10:37+00:00 2026-05-31T21:10:37+00:00

I am trying to create a post request to the tumblr api. Shown below

  • 0

I am trying to create a post request to the tumblr api. Shown below is an extract from said api:

The Write API is a very simple HTTP interface. To create a post, send a POST request to http://www.tumblr.com/api/write with the following parameters:
    email - Your account's email address.
    password - Your account's password.
    type - The post type.

These are the essential elements. I would like to send a photo to the api. According to the API, this is how I would structure my request:

email: myEmail
password: myPassword
type: photo
data: "c:\\img.jpg"

Thanks to dtb, I can send a REGULAR post, which only uses a string to send text, it does not support sending images.

var postData = new NameValueCollection
{
    { "email", email },
    { "password", password },
    { "type", regular },
    { "body", body }
};

using (var client = new WebClient())
{
     client.UploadValues("http://www.tumblr.com/api/write", data: data);
}

This works for sending a regular, however according to the API, I should send the image in a multipart/form-data,
alternatively I could send it in a Normal POST method,
however, filesizes are not as high as allowd with the former.

client.UploadValues supports data: which allows me to pass postData in to it.
client.UploadData also does but I cannot figure out how to use it, I have referred to the documentation.
Also, an opened file cannot be passed in a NameValueCollection which baffles me as to how I could possibly send the request.

Please, if anyone knows the answer I would be extremely grateful if you would help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T21:10:38+00:00Added an answer on May 31, 2026 at 9:10 pm

    I was able to figure this out using RestSharp library.

    //Create a RestClient with the api's url
    var restClient = new RestClient("http://tumblr.com/api/write");
    
    //Tell it to send a POST request
    var request = new RestRequest(Method.POST);
    
    //Set format and add parameters and files
    request.RequestFormat = DataFormat.Json; //I don't know if this line is necessary
    
    request.AddParameter("email", "EMAIL");
    request.AddParameter("password", "PASSWORD");
    request.AddParameter("type", "photo");
    request.AddFile("data", "C:\\Users\\Kevin\\Desktop\\Wallpapers\\1235698997718.jpg");
    
    //Set RestResponse so you can see if you have an error
    RestResponse response = restClient.Execute(request);
    //MessageBox.Show(response) Perhaps I could wrap this in a try except?
    

    It works, but I’m not sure if it’s the best way to do it though.

    If anyone has some more suggestions I will gladly take them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create an HTTP POST request in android where I pass
I'm trying to create an auto generated post excerpt from the current page's post
I am trying to create a zip file from post attachments in wordpress .
I'm trying to create a simple spring based webservice that supports a post with
I'm trying to create a POST request, unfortunately the body of the POST never
I'm trying to find out if a Flash application can create a POST request,
I'm trying to create a http request to our web service, my test XML
I'm trying to send a POST request to a simple WCF service I wrote,
I'm trying to do an HTTP POST REQUEST on .NET Compact Framework and I
I'm trying to send a POST request from an external Ruby script to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.