Get RTMP uri to Youtube LiveStream video - youtube

Can I get RTMP uri of Youtube live-stream using live-stream ID with Youtube Data API v3? For example, for this channel: https://www.youtube.com/watch?v=4YKR-rEwOr8
When I try to do this using "try" page https://developers.google.com/youtube/v3/live/docs/liveStreams/list (part = "status,cdn", id = "4YKR-rEwOr8") I got empty list:
200 OK
- Hide headers -
Cache-Control: private, max-age=0, must-revalidate, no-transform
Content-Encoding: gzip
Content-Length: 183
Content-Type: application/json; charset=UTF-8
Date: Mon, 27 Oct 2014 11:10:54 GMT
Etag: "PSjn-HSKiX6orvNhGZvglLI2lvk/HzQflIssFHeC_PS9MZIweemMYZg"
Expires: Mon, 27 Oct 2014 11:10:54 GMT
Server: GSE
{
"kind": "youtube#liveStreamListResponse",
"etag": "\"PSjn-HSKiX6orvNhGZvglLI2lvk/HzQflIssFHeC_PS9MZIweemMYZg\"",
"pageInfo": {
"totalResults": 0,
"resultsPerPage": 0
},
"items": [
]
}
What I do wrong? I really don't understand.

Related

With URI gem in Ruby, how do I actually parse this cookie that has paths, etc?

When I get some cookies back from the server, I'm needing to only pass the key=value parameters in the next request. I don't need the path information, expiration, etc. However, when I inspect the hash, I get all of that back and find no real way to only parse and keep the important information.
For example, here's the cookie returned from my HTTP POST request:
[1] pry(main)> headers['Cookie']
=> "ds_user=testuser; expires=Fri, 01-Sep-2017 22:20:55 GMT; Max-Age=7776000; Path=/, rur=ATN; Path=/, csrftoken=V6pcoCJdHJLb7BGu2BV8TwE5ZoA5fm; expires=Sat, 02-Jun-2018 22:20:55 GMT; Max-Age=31449600; Path=/; Secure, mid=WTM2RwABAAHw09zRkX55hIbjqszz; expires=Fri, 29-May-2037 22:20:55 GMT; Max-Age=630720000; Path=/, uid=554580241; expires=Fri, 01-Sep-2017 22:20:55 GMT; Max-Age=7776000; Path=/, sessionid=4be2b3d03caf0f3073ce8f1215a2d723a23981a52b0c%3AZ0Y0P0yRXSvpy2gBwZguWo4zoOpGajRA%3A%7B%22_auth_user_id%22%3A5545802841%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_token_ver%22%3A2%2C%22_token%22%3A%225545802841%3Ai2MlZYtSByn9IVBMuL8AHkCq0fX4HI7N%3A480fd4a05bfcdd081c70d0c4c4391883064a35cdd43402506937e611590d92a2%22%2C%22_platform%22%3A1%2C%22last_refreshed%22%3A1496528455.4560296535%7D; expires=Fri, 01-Sep-2017 22:20:55 GMT; HttpOnly; Max-Age=7776000; Path=/; Secure"
I can't do something like headers['Cookie'].split("; ") because the semicolon (;) appears at random parts of the cookie returned in the header.
So for example, when I submit the next request using the cookies returned from that request, it needs to look something like:
Cookie: csrftoken=hgsdco49G6E1EOyR48ofKhtG0P; ds_user=testuser; uid=55458041; mid=WTIRigABAAFjQJOKtJ3jaWGbi70P; rur=ATN; sessionid=a9c568a15f567fb8bf9752a3%3AIMAaCgikVRROWcqGu6aoBhJTx5VGutKh%3A%7B%22_auth_user_id%22%3A5545802841%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_token_ver%22%3A2%2C%22_token%22%3A%225545802841%3AyvzFW559ItJDPMOY9CyBja4NfW049qxy%3A4c5e7c48a20d3c8a1cbc4d0f9a0631449ff24c9b1dbc35a0f80f50568d0a3365%22%2C%22_platform%22%3A1%2C%22last_refreshed%22%3A1496453514.4971137047%7D
Any idea what the easiest way to achieve this would be?
Considerer that the cookie is separed by ";" and under the Path is separated by commas you can proceed working as follow:
pry(main)> cookie = headers['Cookie']
=> "ds_user=testuser; expires=Fri, 01-Sep-2017 22:20:55 GMT; Max-Age=7776000; Path=/, rur=ATN; Path=/, csrftoken=V6pcoCJdHJLb7BGu2BV8TwE5ZoA5fm; expires=Sat, 02-Jun-2018 22:20:55 GMT; Max-Age=31449600; Path=/; Secure, mid=WTM2RwABAAHw09zRkX55hIbjqszz; expires=Fri, 29-May-2037 22:20:55 GMT; Max-Age=630720000; Path=/, uid=554580241; expires=Fri, 01-Sep-2017 22:20:55 GMT; Max-Age=7776000; Path=/, sessionid=4be2b3d03caf0f3073ce8f1215a2d723a23981a52b0c%3AZ0Y0P0yRXSvpy2gBwZguWo4zoOpGajRA%3A%7B%22_auth_user_id%22%3A5545802841%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_token_ver%22%3A2%2C%22_token%22%3A%225545802841%3Ai2MlZYtSByn9IVBMuL8AHkCq0fX4HI7N%3A480fd4a05bfcdd081c70d0c4c4391883064a35cdd43402506937e611590d92a2%22%2C%22_platform%22%3A1%2C%22last_refreshed%22%3A1496528455.4560296535%7D; expires=Fri, 01-Sep-2017 22:20:55 GMT; HttpOnly; Max-Age=7776000; Path=/; Secure"
pry(main)> cookie.split(";").each do |f|
f =~ /^(.*?)=(.*?)$/
if $1 == " Path" then
puts "There is a #{$1} that contains #{$2}"
else
puts "#{$1} = #{$2}"
end
end
pry(main)* ds_user = testuser
expires = Fri, 01-Sep-2017 22:20:55 GMT
Max-Age = 7776000
There is a Path that contains /, rur=ATN
There is a Path that contains /, csrftoken=V6pcoCJdHJLb7BGu2BV8TwE5ZoA5fm
expires = Sat, 02-Jun-2018 22:20:55 GMT
Max-Age = 31449600
There is a Path that contains /
Secure, mid = WTM2RwABAAHw09zRkX55hIbjqszz
expires = Fri, 29-May-2037 22:20:55 GMT
Max-Age = 630720000
There is a Path that contains /, uid=554580241
expires = Fri, 01-Sep-2017 22:20:55 GMT
Max-Age = 7776000
There is a Path that contains /, sessionid=4be2b3d03caf0f3073ce8f1215a2d723a23981a52b0c%3AZ0Y0P0yRXSvpy2gBwZguWo4zoOpGajRA%3A%7B%22_auth_user_id%22%3A5545802841%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_token_ver%22%3A2%2C%22_token%22%3A%225545802841%3Ai2MlZYtSByn9IVBMuL8AHkCq0fX4HI7N%3A480fd4a05bfcdd081c70d0c4c4391883064a35cdd43402506937e611590d92a2%22%2C%22_platform%22%3A1%2C%22last_refreshed%22%3A1496528455.4560296535%7D
expires = Fri, 01-Sep-2017 22:20:55 GMT
=
Max-Age = 7776000
There is a Path that contains /
=
=> ["ds_user=testuser",
" expires=Fri, 01-Sep-2017 22:20:55 GMT",
" Max-Age=7776000",
" Path=/, rur=ATN",
" Path=/, csrftoken=V6pcoCJdHJLb7BGu2BV8TwE5ZoA5fm",
" expires=Sat, 02-Jun-2018 22:20:55 GMT",
" Max-Age=31449600",
" Path=/",
" Secure, mid=WTM2RwABAAHw09zRkX55hIbjqszz",
" expires=Fri, 29-May-2037 22:20:55 GMT",
" Max-Age=630720000",
" Path=/, uid=554580241",
" expires=Fri, 01-Sep-2017 22:20:55 GMT",
" Max-Age=7776000",
" Path=/, sessionid=4be2b3d03caf0f3073ce8f1215a2d723a23981a52b0c%3AZ0Y0P0yRXSvpy2gBwZguWo4zoOpGajRA%3A%7B%22_auth_user_id%22%3A5545802841%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_token_ver%22%3A2%2C%22_token%22%3A%225545802841%3Ai2MlZYtSByn9IVBMuL8AHkCq0fX4HI7N%3A480fd4a05bfcdd081c70d0c4c4391883064a35cdd43402506937e611590d92a2%22%2C%22_platform%22%3A1%2C%22last_refreshed%22%3A1496528455.4560296535%7D",
" expires=Fri, 01-Sep-2017 22:20:55 GMT",
" HttpOnly",
" Max-Age=7776000",
" Path=/",
" Secure"]
Be careful with the space after ; and proceed with whath you wnat inside the path

Convert raw image data to base64 encoded string

I am downloading a thumbnail from dropbox using the following API:
https://www.dropbox.com/developers/documentation/http/documentation#files-get_thumbnail
This is part of my function from cloud code:
}).then(function(oauthToken){
/* Retrieve thumbnail image from dropbox */
return Parse.Cloud.httpRequest({
method: 'POST',
url: 'https://content.dropboxapi.com/2/files/get_thumbnail',
headers: {
'Authorization': 'Bearer ' + oauthToken.get("accessToken"),
'Dropbox-API-Arg': JSON.stringify({"path": dropboxFileId})
}
});
}).then(function(imageResponse){
if (log) {console.log(imageResponse);}
var imageBuffer = imageResponse.buffer;
var image = imageBuffer.toString("base64");
response.success(image);
}, function(error){
response.error(error.text);
});
Following is my imageResponse:
{ status: 200,
headers:
{ server: 'nginx',
date: 'Wed, 16 Mar 2016 04:30:54 GMT',
'content-type': 'application/octet-stream',
'content-length': '906',
connection: 'close',
'accept-ranges': 'bytes',
pragma: 'no-cache',
'cache-control': 'no-cache',
'original-content-length': '906',
'dropbox-api-result': '{"name": "HTS-logo-low-res.png", "path_lower": "/hts-logo-low-res.png", "path_display": "/HTS-logo-low-res.png", "id": "id:hrkr_mV5FYAAAAAAAAAAHw", "client_modified": "2015-04-05T04:16:15Z", "server_modified": "2016-02-13T06:08:02Z", "rev": "2a043d0c726", "size": 10506}',
'x-server-response-time': '190',
'x-dropbox-request-id': '04bb8d6b45511f2b2d7a278e230ea572',
'x-robots-tag': 'noindex, nofollow, noimageindex' },
buffer: <Buffer ef bf bd ef bf bd ef bf bd ef bf bd 00 10 4a 46 49 46 00 01 01 00 00 01 00 01 00 00 ef bf bd ef bf bd 00 43 00 06 04 05 06 05 04 06 06 05 06 07 07 06 ... >,
cookies: undefined,
text: '����\u0000\u0010JFIF\u0000\u0001\u0001\u0000\u0000\u0001\u0000\u0001\u0000\u0000��\u0000C\u0000\u0006\u0004\u0005\u0006\u0005\u0004\u0006\u0006\u0005\u0006\u0007\u0007\u0006\b\n\u0010\n\n\t\t\n\u0014\u000e\u000f\f\u0010\u0017\u0014\u0018\u0018\u0017\u0014\u0016\u0016\u001a\u001d%\u001f\u001a\u001b#\u001c\u0016\u0016 , #&\')*)\u0019\u001f-0-(0%()(��\u0000C\u0001\u0007\u0007\u0007\n\b\n\u0013\n\n\u0013(\u001a\u0016\u001a((((((((((((((((((((((((((((((((((((((((((((((((((��\u0000\u0011\b\u0000\u0010\u0000#\u0003\u0001"\u0000\u0002\u0011\u0001\u0003\u0011\u0001��\u0000\u001f\u0000\u0000\u0001\u0005\u0001\u0001\u0001\u0001\u0001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b��\u0000�\u0010\u0000\u0002\u0001\u0003\u0003\u0002\u0004\u0003\u0005\u0005\u0004\u0004\u0000\u0000\u0001}\u0001\u0002\u0003\u0000\u0004\u0011\u0005\u0012!1A\u0006\u0013Qa\u0007"q\u00142���\b#B��\u0015R��$3br�\t\n\u0016\u0017\u0018\u0019\u001a%&\'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz���������������������������������������������������������������������������\u0000\u001f\u0001\u0000\u0003\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b��\u0000�\u0011\u0000\u0002\u0001\u0002\u0004\u0004\u0003\u0004\u0007\u0005\u0004\u0004\u0000\u0001\u0002w\u0000\u0001\u0002\u0003\u0011\u0004\u0005!1\u0006\u0012AQ\u0007aq\u0013"2�\b\u0014B����\t#3R�\u0015br�\n\u0016$4�%�\u0017\u0018\u0019\u001a&\'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������\u0000\f\u0003\u0001\u0000\u0002\u0011\u0003\u0011\u0000?\u0000�;ŷ��鱘\'[s,�\u0013L�\n���{\f�g޹\u000f��I�\\.�w\u0013��H~̡���\u0002�\u001b���\u000f\u0001���#�%�&�O��\u0004z����6�Z:X�"G;�GB}M%N�3��ͧ]4��̪��9`�������0�֕�+\u000b�t \u0006P�\u0001%�z��\u0003�R=ި�G$.� �U��h]���d�\u001d9����u���*O����q��|�\u0007\u0005\\�N\u000e\u0017\u0003�\u0000C�q��;�K���1\u001e��HR��z��~�N+���uy��d�بS咕�0e��91�\u001fC�\u0014���}z����.u\u0019Y�I\u0012�T.�\u0019~�\u0007ߦ\b��+���ߝ��W���_q��'
}
My code in XCode:
if let imageInBase64 = response as? String {
print(imageInBase64)
let decodedImage = NSData(base64EncodedString: imageInBase64, options: NSDataBase64DecodingOptions())
imageView.image = UIImage(data: decodedImage!)
}
Following is the output for imageInBase64:
77+977+977+977+9ABBKRklGAAEBAAABAAEAAO+/ve+/vQBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSjvv73vv70AQwEHBwcKCAoTCgoTKBoWGigoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgo77+977+9ABEIABAAQAMBIgACEQEDEQHvv73vv70AHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL77+977+9AO+/vRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDLvv73vv73vv70II0Lvv73vv70VUu+/ve+/vSQzYnLvv70JChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl677+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+977+9AB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC++/ve+/vQDvv70RAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjLvv70IFELvv73vv73vv73vv70JIzNS77+9FWJy77+9ChYkNO+/vSXvv70XGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eu+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/ve+/vQAMAwEAAhEDEQA/AO+/vTvFt++/ve+/vemxmCdbcyzvv70TTO+/vQrvv73vv73vv717DO+/vWfeuX8P77+977+9Se+/vVwu77+9dxPvv73vv71Ifsyh77+977+977+9Au+/vRvvv73vv73vv70PAe+/ve+/ve+/vUDvv70l77+9Ju+/vU/vv73vv70Eeu+/ve+/ve+/ve+/vTbvv71aOljvv70iRzvvv71HQn1NJU7vv70z77+977+9zaddNO+/ve+/vcyq77+977+9OWDvv73vv73vv73vv73vv73vv73vv70w77+91pXvv70rC++/vXQgBlDvv70BJe+/vXrvv73vv70D77+9Uj3eqO+/vUckLu+/vSDvv71V77+977+9aF3vv73vv73vv71k77+9HTnvv73vv73vv73vv71177+977+977+9Kk/vv73vv73vv73vv71x77+977+9fO+/vQcFXO+/vU4OFwPvv70AQ++/vXHvv73vv70777+9S++/ve+/ve+/vTEe77+977+9SFLvv73vv71677+977+9fu+/vU4r77+977+977+9dXnvv73vv71k77+92KhT5ZKV77+9MGXvv73vv705Me+/vR9D77+9FO+/ve+/ve+/vX1677+977+977+977+9LnUZWe+/vUkS77+9VC7vv70Zfu+/vQffpgjvv73vv70r77+977+977+9353vv73vv71X77+977+977+9X3Hvv73vv70=
When I run this, I do not get an image displayed. I suspect that I am not properly handling the response from Dropbox before converting it to base64 string. Dropbox state that their responses are raw image data.
Any help will be much appreciated. Thanks.
Figured it out & thanks for those who answered. The issue was with Parse.com module Parse.Cloud.httpRequest which works slightly different when you are self-hosting parse-server vs Parse.com. I just needed to include encoding: null as an option in the module and everything works fine. Code below:
}).then(function(oauthToken){
/* Retrieve thumbnail image from dropbox */
return Parse.Cloud.httpRequest({
method: 'POST',
url: 'https://content.dropboxapi.com/2/files/get_thumbnail',
headers: {
'Authorization': 'Bearer ' + oauthToken.get("accessToken"),
'Dropbox-API-Arg': JSON.stringify({"path": dropboxFileId})
},
encoding: null
});
}).then(function(imageResponse){
if (log) {console.log(imageResponse);}
var imageBuffer = imageResponse.buffer;
var image = imageBuffer.toString("base64");
response.success(image);
}, function(error){
response.error(error.text);
});

HTTP Error 415 Unsupported media type

I am still on the same problem as:
Upload binary data with HTTP PUT with jersey jaxrs-ri-2.01
But I am one step further. Now I am testing my data upload with this tool:
I'm Only Resting
The problem, and I don't know if it's a client or a server problem is that when I'm testing, I get HTTP 415 - Unsupported Media Type
In the client:
I have checked the PUT method
In the body I have put one blank line (return) and in the second line i wrote test
In the server, It was working until I added this parameter
#FormDataParam("file") InputStream pBodyDataStream
and this code:
try {
OutputStream lOutputStream = new FileOutputStream(new File("F:/test.bin"));
int read = 0;
byte[] bytes = new byte[fragmentSize];
while ((read = pBodyDataStream.read(bytes)) != -1) {
lOutputStream.write(bytes, 0, read);
}
lOutputStream.close();
pBodyDataStream.close();
} catch (IOException e) {
// fragment reception error
// HTTP 500 error
lOutput = xmlError("Upload error while transferring fragment");
e.printStackTrace();
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(lOutput).build();
}
Here is a screenshot of the test tool with the parameters:
Here is the cURL investigation:
The command line:
curl -v -H "application/octet-stream" -K params_curl.txt
The cURL parameters file:
url = "localhost:8080/ServeurWS/softplus/biens/arts/2345412/images?user=wow&pass=wow&taille=100&numfrag=1&taillefrag=10&md5=d6aa97d33d459ea3670056e737c99a3d&md6=5da8aa7126701c9840f99f8e9fa54976"
request="PUT"
upload-file="f:/vcredist.bmp"
output = "output.html"
user-agent = "superagent/1.0"
The headers I see, thanks to the -v option:
C:\Users\Dev\Desktop>curl -v -I -H "application/octet-stream" -K params_curl.txt
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying ::1...
* Connected to localhost (::1) port 8080 (#0)
> PUT /ServeurWS/softplus/biens/arts/2345412/images?user=wow&pass=wow&taille=100&numfrag=1&taillefrag=10&md5=d6aa97d33d459ea3670056e737c99a3d&md6=5da8aa7126701
c9840f99f8e9fa54976 HTTP/1.1
> Host: localhost:8080
> User-Agent: superagent/1.0
> Accept: */*
> Content-Length: 5686
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
} [5686 bytes data]
* We are completely uploaded and fine
< HTTP/1.1 415 Type de Support Non Supporté
< Server: Apache-Coyote/1.1
< Content-Type: text/html;charset=utf-8
< Content-Length: 1108
< Date: Wed, 02 Dec 2015 13:56:07 GMT
<
{ [1108 bytes data]
100 6794 100 1108 100 5686 11080 56860 --:--:-- --:--:-- --:--:-- 63177
* Connection #0 to host localhost left intact
The output.html file:
HTTP/1.1 100 Continue
HTTP/1.1 415 Type de Support Non Supporté
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Length: 1108
Date: Wed, 02 Dec 2015 13:56:07 GMT
<html><head><title>Apache Tomcat/6.0.44 - Rapport d'erreur</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>Etat HTTP 415 - Unsupported Media Type</h1><HR size="1" noshade="noshade"><p><b>type</b> Rapport d'état</p><p><b>message</b> <u>Unsupported Media Type</u></p><p><b>description</b> <u>Le serveur a refusé cette requête car l'entité de requête est dans un format non supporté par la ressource demandée avec la méthode spécifiée.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.44</h3></body></html>
And there is no error in the Eclipse console...

HTTP 302 - Not found parameter GSessionID - Google Calendar

I need help .
I want to create events on google calendar with a desktop application , when the parameters sent
url = 'https://www.google.com/calendar/feeds/emaill%40gmail.com/private/full';
and then add xml where this event to create
createXML := '<?xml version=''1.0'' encoding=''UTF-8''?>'#13#10 +
'<entry xmlns=''http://www.w3.org/2005/Atom'''#13#10 +
'xmlns:gd=''http://schemas.google.com/g/2005''>'#13#10 +
'<category scheme=''http://schemas.google.com/g/2005#kind'''#13#10 +
'term=''http://schemas.google.com/g/2005#event''></category>'#13#10 +
'<title type=''text''>' + title + '</title>'#13#10 +
'<content type=''text''>' + content + '</content>'#13#10 +
'<gd:transparency'#13#10 +
'value=''http://schemas.google.com/g/2005#event.opaque''>'#13#10 +
'</gd:transparency>'#13#10 +
'<gd:eventStatus'#13#10 +
'value=''http://schemas.google.com/g/2005#event.confirmed''>'#13#10 +
'</gd:eventStatus>'#13#10 +
'<gd:where valueString=''' + location + '''></gd:where>'#13#10 +
'<gd:when startTime=''' + EventStartTime + ''''#13#10 +
'endTime=''' + EventEndTime + '''></gd:when>'#13#10 +
'</entry>';
When I do the POST process the next header appears
HTTP/1.0 302 Moved Temporarily
Expires: Wed, 30 April 2014 17:37:17 GMT
Date: Wed, 30 April 2014 17:37:17 GMT
Set- Cookie: T=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;
Expires = Tue, 13 -May- 2014 10:32:28 GMT;
SecureLocation : https://www.google.com:443/calendar/feeds/default/private/full?t=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content- Type: text / html ; charset = UTF -8
Cache- Control: private , max -age = 0
X -Content -Type -Options : nosniff
X -Frame -Options : SAMEORIGIN
X -XSS -Protection : 1; mode = block
Server : GSE
Alternate -Protocol : 443: quic
In the manual, Google listed me I need a variable called " GSessionID " but does not appear to me,
I would please help me with this problem .
I have two projects with authentication: ClientLogin and OAuth 2.0
as I get to get this parameter?
Thanks a lot.
Us Google Translator
It has to work to retrieve the newly loaded gsessionID condition Realize post procedure twice, the second in the exception
try
idHTTP2.Post(URL,XML);
except on E: EIdHTTPProtocolException do
idHTTP2.Post(URL,XML);
end;
Thanks for your time.

UDP HTTP Header parsing in Ruby

I get the following response from a a UDP Socket:
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
DATE: Thu, 08 Nov 2012 12:32:33 GMT
EXT:
LOCATION: http://192.168.0.100:49153/nmrDescription.xml
SERVER: Windows2000/0.0 UPnP/1.0 PhilipsIntelSDK/1.4 DLNADOC/1.50
X-User-Agent: redsonic
ST: upnp:rootdevice
USN: uuid:F00DBABE-SA5E-BABA-DADA188ED55ED539::upnp:rootdevice
Is there a library, or simple way to parse all this ?
I'd like to get something like the following:
{
:cache_control => "max-age=1800"
:date => "Thu, 08 Nov 2012 12:32:33 GMT"
:ext => nil
:location => "http://192.168.0.100:49153/nmrDescription.xml"
# Etc.
}
response.split($/).drop(1).inject({}) do |h, l|
k, v = l.split(": ", 2)
h[k.downcase.gsub("-", "_").to_sym] = (v unless v.empty?)
h
end
# => {
# :cache_control=>"max-age=1800",
# :date=>"Thu, 08 Nov 2012 12:32:33 GMT",
# :ext=>nil,
# :location=>"http://192.168.0.100:49153/nmrDescription.xml",
# :server=>"Windows2000/0.0 UPnP/1.0 PhilipsIntelSDK/1.4 DLNADOC/1.50",
# :x_user_agent=>"redsonic",
# :st=>"upnp:rootdevice",
# :usn=>"uuid:F00DBABE-SA5E-BABA-DADA188ED55ED539::upnp:rootdevice"
#}

Resources