Sunday, March 4, 2012

[YouTube-API] GetUploadToken returns only headers - empty body, no XML

Hello, I'm trying to upload video at youtube using ClientLogin. It even worked for me yesterday, but something happened and it stopped working.
The problem is that i'm recieving empty response which has no XML code in it's body, while youtube response is "HTTP/1.1 200 OK".
I'm using PHP with curl and fsockopen(). And I'm pretty sure I'm doing everything right.
Here are the complete log of requests:

// with curl

RESPONSE:
HTTP/1.1 200 OK
X-GData-User-Country: UA
Content-Type: text/plain
Content-Length: 299
Date: Sun, 04 Mar 2012 13:08:46 GMT
Expires: Sun, 04 Mar 2012 13:08:46 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE

Auth=DQA...jGw
YouTubeUser=MYUSER

// with fsockopen()

REQUEST:
POST /action/GetUploadToken HTTP/1.1
Content-Type: application/atom+xml; charset=UTF-8
Content-Length: 797
Authorization: GoogleLogin auth=DQA...jGw
X-GData-Client: MYUSER
X-GData-Key: key=AI3...JKA

<?xml version='1.0'?>
<media:group>
<media:title type='plain'>something</media:title>
<media:description type='plain'>some descr</media:description>
<media:category scheme='http://gdata.youtube.com/schemas/2007/categories.cat'>Film</media:category>
<media:keywords>keywords</media:keywords>
</media:group>
</entry>

RESPONSE:
HTTP/1.1 200 OK
X-GData-User-Country: UA
Content-Type: text/xml; charset=UTF-8
Transfer-Encoding: chunked
Date: Sun, 04 Mar 2012 13:08:46 GMT
Expires: Sun, 04 Mar 2012 13:08:46 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE

--------------
And that's all. Response even have no Content-length value! There is no response at all. Please, help! This is very urgent for me...

--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To view this discussion on the web visit https://groups.google.com/d/msg/youtube-api-gdata/-/JyC-fM5eAiMJ.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.

No comments:

Post a Comment