Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

YouTube API Upload - error in post 400 bad request

$
0
0

I have some .net code which produces the following post (raw data copied from fiddler, binary data truncated) however I am getting a 400 bad request every time I send the request:

POST http://uploads.gdata.youtube.com/feeds/api/users/default/uploads HTTP/1.1Authorization: OAuth ya29.AHES6ZTq4wOyYah1NRGrelvmg8icDsKwjkZuhN_IOdgDX75-GData-Version: 2X-GData-Key: key=..apikey...Slug: sample.AVIContent-Type: multipart/related; boundary="dsjdwdjd3"Host: uploads.gdata.youtube.comContent-Length: 1980444Expect: 100-continueConnection: Close--dsjdwdjd3Content-Type: application/atom+xml; charset=UTF-8<?xml version="1.0" encoding="utf-8"?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007"><media:group><media:title type="plain">testVideo1</media:title><media:description type="plain">this is a test video1</media:description><media:category scheme="http://gdata.youtube.com/schemas/2007/categories.cat">People</media:category><media:keywords>test1</media:keywords></media:group></entry>--dsjdwdjd3Content-Type: video/aviContent-Transfer-Encoding: binaryRIFF�4�AVI LIST&....... truncated binary....--dsjdwdjd3

Here is the Google documentation on the POST, however as far as I can see its exactly the same: https://developers.google.com/youtube/2.0/developers_guide_protocol_direct_uploading.

My code behind is sending this as a httpwebrequest and that is as far as I've got.

EDIT: I do not believe it is a authentication or developer key issue as I have intentionally entered incorrect details and it comes back with a 401 invalid token or invalid developer key.

EDIT 2: complete response, pasted in raw format from fiddler

HTTP/1.1 400 Bad RequestServer: HTTP Upload Server Built on Apr 10 2012 14:42:33 (1334094153)Content-Type: text/html; charset=UTF-8X-GUploader-UploadID: AEnB2Up2iQ676IS9KRGmvmdbgBFGZLwLXHmnSv3cTUu-1TAHbuylsLncHOK0Q0MBSg22ZaGQ8aQ3JQps5bmAJ9xaYtYq1jNI_QDate: Mon, 16 Apr 2012 10:11:10 GMTPragma: no-cacheExpires: Fri, 01 Jan 1990 00:00:00 GMTCache-Control: no-cache, no-store, must-revalidateContent-Length: 15Connection: closeInvalid Request

Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>