使用RestSharp将照片上传到Tumblr [英] Upload photo to Tumblr using RestSharp

查看:343
本文介绍了使用RestSharp将照片上传到Tumblr的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过RestSharp将照片上传到Tumblr。这是我的代码。



I'm tying to upload photo to Tumblr via RestSharp. Here are my code.

var restClient = new RestClient("http://tumblr.com/api/write");
  var request = new RestRequest(Method.POST);


  request.RequestFormat = DataFormat.Json;

  request.AddParameter("email", "123@456.com");
  request.AddParameter("password", "acb");
  request.AddParameter("type", "photo");
  request.AddParameter("caption", "testing");
  request.AddFile("data", "C:\\photo\\photo1.jpg");

  IRestResponse response = restClient.Execute(request);





代码执行后没有任何反应。我的代码有什么问题吗?在此先感谢。



p.s:是否需要oauth?



Nothing happen after the code been executed. Is there anything wrong with my code? Thanks in advance.

p.s : Is oauth needed?

推荐答案

这篇关于使用RestSharp将照片上传到Tumblr的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆