无法上传到twitpic

我正尝试使用该API上传照片,并且遇到了一个我希望能够帮助我解决的问题。 下面,我将http请求粘贴到API(减去twitter用户名/密码)。 我收到一条错误信息,说没有找到图像,即使图像中有“媒体”的名称。 我在我的最后创建了一个简单的Web项目来测试以确保图像正确编码,而且它是。 这个请求中是否有任何东西可以让你看到会导致api拒绝?

谢谢

POST /api/upload HTTP/1.1
Accept: */*
Referer: http://localhost:31898/ClientBin/DragDropTwitPic.xap
Content-Length: 2779
Content-Type: multipart/form-data; boundary=1eb2cc59-c390-4022-a47f-bb5c5a514e27
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Zune 4.0; MS-RTC LM 8; .NET4.0C; .NET4.0E)
Host: twitpic.com
Connection: Keep-Alive
Pragma: no-cache
--1eb2cc59-c390-4022-a47f-bb5c5a514e27
Content-Disposition: form-data, name="media"; filename="test.jpg"
Content-Type: image/pjpeg
{encoded image removed}

--1eb2cc59-c390-4022-a47f-bb5c5a514e27
Content-Disposition: form-data; name="username"
{removed from this post}
--1eb2cc59-c390-4022-a47f-bb5c5a514e27
Content-Disposition: form-data; name="password"
{removed from this post}
--1eb2cc59-c390-4022-a47f-bb5c5a514e27--

弄清楚了。 在文件上传的内容类型配置中,我有这样的:

Content-Disposition:form-data,name =“media”; 文件名= “test.jpg放在”

而不是以下要求:Content-Disposition:form-data; NAME = “媒体”; 文件名= “test.jpg放在”

愚蠢的逗号。

链接地址: http://www.djcxy.com/p/46471.html

上一篇: Trouble uploading to twitpic

下一篇: Comparison of the multiprocessing module and pyro?