gdata_19 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.hgtags +5 -0
- data/LICENSE +202 -0
- data/README +97 -0
- data/Rakefile +82 -0
- data/VERSION +1 -0
- data/bin/test_captcha.rb +52 -0
- data/doc/classes/GData/Auth/AuthSub.html +349 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000020.html +29 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000021.html +29 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000022.html +31 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000023.html +29 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000024.html +32 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000025.html +26 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000026.html +29 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000038.html +28 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000039.html +29 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000040.html +31 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000041.html +29 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000042.html +32 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000043.html +28 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000044.html +29 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000045.html +31 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000046.html +28 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000047.html +28 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000048.html +29 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000049.html +31 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000050.html +28 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000051.html +31 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000052.html +25 -0
- data/doc/classes/GData/Auth/AuthSub.src/M000053.html +29 -0
- data/doc/classes/GData/Auth/ClientLogin.html +232 -0
- data/doc/classes/GData/Auth/ClientLogin.src/M000027.html +27 -0
- data/doc/classes/GData/Auth/ClientLogin.src/M000028.html +47 -0
- data/doc/classes/GData/Auth/ClientLogin.src/M000029.html +22 -0
- data/doc/classes/GData/Auth/ClientLogin.src/M000045.html +29 -0
- data/doc/classes/GData/Auth/ClientLogin.src/M000046.html +49 -0
- data/doc/classes/GData/Auth/ClientLogin.src/M000047.html +22 -0
- data/doc/classes/GData/Auth/ClientLogin.src/M000050.html +29 -0
- data/doc/classes/GData/Auth/ClientLogin.src/M000051.html +49 -0
- data/doc/classes/GData/Auth/ClientLogin.src/M000052.html +22 -0
- data/doc/classes/GData/Auth/ClientLogin.src/M000053.html +29 -0
- data/doc/classes/GData/Auth/ClientLogin.src/M000054.html +29 -0
- data/doc/classes/GData/Auth/ClientLogin.src/M000055.html +49 -0
- data/doc/classes/GData/Auth/ClientLogin.src/M000056.html +22 -0
- data/doc/classes/GData/Auth.html +133 -0
- data/doc/classes/GData/Client/Apps.html +146 -0
- data/doc/classes/GData/Client/Apps.src/M000027.html +19 -0
- data/doc/classes/GData/Client/Apps.src/M000028.html +19 -0
- data/doc/classes/GData/Client/AuthorizationError.html +113 -0
- data/doc/classes/GData/Client/BadRequestError.html +113 -0
- data/doc/classes/GData/Client/Base.html +453 -0
- data/doc/classes/GData/Client/Base.src/M000002.html +21 -0
- data/doc/classes/GData/Client/Base.src/M000003.html +55 -0
- data/doc/classes/GData/Client/Base.src/M000004.html +18 -0
- data/doc/classes/GData/Client/Base.src/M000005.html +18 -0
- data/doc/classes/GData/Client/Base.src/M000006.html +18 -0
- data/doc/classes/GData/Client/Base.src/M000007.html +18 -0
- data/doc/classes/GData/Client/Base.src/M000008.html +22 -0
- data/doc/classes/GData/Client/Base.src/M000009.html +26 -0
- data/doc/classes/GData/Client/Base.src/M000010.html +22 -0
- data/doc/classes/GData/Client/Base.src/M000011.html +25 -0
- data/doc/classes/GData/Client/Base.src/M000012.html +25 -0
- data/doc/classes/GData/Client/Base.src/M000013.html +33 -0
- data/doc/classes/GData/Client/Base.src/M000014.html +44 -0
- data/doc/classes/GData/Client/Base.src/M000015.html +18 -0
- data/doc/classes/GData/Client/Base.src/M000016.html +18 -0
- data/doc/classes/GData/Client/Base.src/M000017.html +18 -0
- data/doc/classes/GData/Client/Base.src/M000018.html +18 -0
- data/doc/classes/GData/Client/Base.src/M000019.html +18 -0
- data/doc/classes/GData/Client/Base.src/M000020.html +18 -0
- data/doc/classes/GData/Client/Base.src/M000021.html +25 -0
- data/doc/classes/GData/Client/Base.src/M000022.html +28 -0
- data/doc/classes/GData/Client/Base.src/M000023.html +22 -0
- data/doc/classes/GData/Client/Base.src/M000024.html +18 -0
- data/doc/classes/GData/Client/Base.src/M000025.html +22 -0
- data/doc/classes/GData/Client/Blogger.html +146 -0
- data/doc/classes/GData/Client/Blogger.src/M000002.html +20 -0
- data/doc/classes/GData/Client/BookSearch.html +146 -0
- data/doc/classes/GData/Client/BookSearch.src/M000010.html +20 -0
- data/doc/classes/GData/Client/BookSearch.src/M000011.html +20 -0
- data/doc/classes/GData/Client/Calendar.html +221 -0
- data/doc/classes/GData/Client/Calendar.src/M000030.html +20 -0
- data/doc/classes/GData/Client/Calendar.src/M000031.html +20 -0
- data/doc/classes/GData/Client/Calendar.src/M000032.html +19 -0
- data/doc/classes/GData/Client/Calendar.src/M000033.html +25 -0
- data/doc/classes/GData/Client/Calendar.src/M000034.html +21 -0
- data/doc/classes/GData/Client/CaptchaError.html +167 -0
- data/doc/classes/GData/Client/CaptchaError.src/M000001.html +19 -0
- data/doc/classes/GData/Client/CaptchaError.src/M000005.html +19 -0
- data/doc/classes/GData/Client/Contacts.html +146 -0
- data/doc/classes/GData/Client/Contacts.src/M000003.html +20 -0
- data/doc/classes/GData/Client/DocList.html +146 -0
- data/doc/classes/GData/Client/DocList.src/M000006.html +20 -0
- data/doc/classes/GData/Client/DocList.src/M000007.html +20 -0
- data/doc/classes/GData/Client/Error.html +118 -0
- data/doc/classes/GData/Client/Finance.html +146 -0
- data/doc/classes/GData/Client/Finance.src/M000029.html +20 -0
- data/doc/classes/GData/Client/Finance.src/M000030.html +20 -0
- data/doc/classes/GData/Client/GBase.html +146 -0
- data/doc/classes/GData/Client/GBase.src/M000004.html +20 -0
- data/doc/classes/GData/Client/GMail.html +146 -0
- data/doc/classes/GData/Client/GMail.src/M000028.html +20 -0
- data/doc/classes/GData/Client/GMail.src/M000029.html +20 -0
- data/doc/classes/GData/Client/Health.html +146 -0
- data/doc/classes/GData/Client/Health.src/M000031.html +20 -0
- data/doc/classes/GData/Client/Health.src/M000034.html +20 -0
- data/doc/classes/GData/Client/Health.src/M000035.html +20 -0
- data/doc/classes/GData/Client/Notebook.html +146 -0
- data/doc/classes/GData/Client/Notebook.src/M000009.html +20 -0
- data/doc/classes/GData/Client/Notebook.src/M000010.html +20 -0
- data/doc/classes/GData/Client/Photos.html +146 -0
- data/doc/classes/GData/Client/Photos.src/M000008.html +21 -0
- data/doc/classes/GData/Client/Photos.src/M000009.html +21 -0
- data/doc/classes/GData/Client/RequestError.html +167 -0
- data/doc/classes/GData/Client/RequestError.src/M000006.html +20 -0
- data/doc/classes/GData/Client/ServerError.html +113 -0
- data/doc/classes/GData/Client/Spreadsheets.html +146 -0
- data/doc/classes/GData/Client/Spreadsheets.src/M000001.html +20 -0
- data/doc/classes/GData/Client/UnknownError.html +113 -0
- data/doc/classes/GData/Client/VersionConflictError.html +113 -0
- data/doc/classes/GData/Client/WebmasterTools.html +146 -0
- data/doc/classes/GData/Client/WebmasterTools.src/M000007.html +20 -0
- data/doc/classes/GData/Client/WebmasterTools.src/M000008.html +20 -0
- data/doc/classes/GData/Client/YouTube.html +192 -0
- data/doc/classes/GData/Client/YouTube.src/M000013.html +19 -0
- data/doc/classes/GData/Client/YouTube.src/M000014.html +24 -0
- data/doc/classes/GData/Client/YouTube.src/M000025.html +22 -0
- data/doc/classes/GData/Client/YouTube.src/M000026.html +22 -0
- data/doc/classes/GData/Client/YouTube.src/M000027.html +24 -0
- data/doc/classes/GData/Client.html +198 -0
- data/doc/classes/GData/HTTP/DefaultService.html +150 -0
- data/doc/classes/GData/HTTP/DefaultService.src/M000019.html +48 -0
- data/doc/classes/GData/HTTP/DefaultService.src/M000037.html +63 -0
- data/doc/classes/GData/HTTP/DefaultService.src/M000042.html +66 -0
- data/doc/classes/GData/HTTP/DefaultService.src/M000045.html +66 -0
- data/doc/classes/GData/HTTP/DefaultService.src/M000046.html +66 -0
- data/doc/classes/GData/HTTP/MimeBody.html +202 -0
- data/doc/classes/GData/HTTP/MimeBody.src/M000032.html +22 -0
- data/doc/classes/GData/HTTP/MimeBody.src/M000033.html +31 -0
- data/doc/classes/GData/HTTP/MimeBody.src/M000034.html +18 -0
- data/doc/classes/GData/HTTP/MimeBody.src/M000035.html +22 -0
- data/doc/classes/GData/HTTP/MimeBody.src/M000036.html +22 -0
- data/doc/classes/GData/HTTP/MimeBody.src/M000037.html +31 -0
- data/doc/classes/GData/HTTP/MimeBody.src/M000038.html +18 -0
- data/doc/classes/GData/HTTP/MimeBodyString.html +164 -0
- data/doc/classes/GData/HTTP/MimeBodyString.src/M000036.html +19 -0
- data/doc/classes/GData/HTTP/MimeBodyString.src/M000037.html +27 -0
- data/doc/classes/GData/HTTP/MimeBodyString.src/M000039.html +19 -0
- data/doc/classes/GData/HTTP/MimeBodyString.src/M000040.html +19 -0
- data/doc/classes/GData/HTTP/MimeBodyString.src/M000041.html +27 -0
- data/doc/classes/GData/HTTP/Request.html +243 -0
- data/doc/classes/GData/HTTP/Request.src/M000015.html +22 -0
- data/doc/classes/GData/HTTP/Request.src/M000016.html +22 -0
- data/doc/classes/GData/HTTP/Request.src/M000017.html +22 -0
- data/doc/classes/GData/HTTP/Request.src/M000018.html +24 -0
- data/doc/classes/GData/HTTP/Request.src/M000033.html +24 -0
- data/doc/classes/GData/HTTP/Request.src/M000034.html +22 -0
- data/doc/classes/GData/HTTP/Request.src/M000035.html +22 -0
- data/doc/classes/GData/HTTP/Request.src/M000036.html +25 -0
- data/doc/classes/GData/HTTP/Request.src/M000038.html +24 -0
- data/doc/classes/GData/HTTP/Request.src/M000039.html +22 -0
- data/doc/classes/GData/HTTP/Request.src/M000040.html +22 -0
- data/doc/classes/GData/HTTP/Request.src/M000041.html +24 -0
- data/doc/classes/GData/HTTP/Request.src/M000042.html +24 -0
- data/doc/classes/GData/HTTP/Request.src/M000043.html +22 -0
- data/doc/classes/GData/HTTP/Request.src/M000044.html +22 -0
- data/doc/classes/GData/HTTP/Request.src/M000045.html +25 -0
- data/doc/classes/GData/HTTP/Response.html +179 -0
- data/doc/classes/GData/HTTP/Response.src/M000032.html +26 -0
- data/doc/classes/GData/HTTP/Response.src/M000035.html +26 -0
- data/doc/classes/GData/HTTP/Response.src/M000038.html +26 -0
- data/doc/classes/GData/HTTP/Response.src/M000039.html +26 -0
- data/doc/classes/GData/HTTP.html +127 -0
- data/doc/classes/GData.html +226 -0
- data/doc/created.rid +1 -0
- data/doc/files/README.html +214 -0
- data/doc/files/lib/gdata/auth/authsub_rb.html +131 -0
- data/doc/files/lib/gdata/auth/clientlogin_rb.html +129 -0
- data/doc/files/lib/gdata/auth_rb.html +130 -0
- data/doc/files/lib/gdata/client/apps_rb.html +122 -0
- data/doc/files/lib/gdata/client/base_rb.html +122 -0
- data/doc/files/lib/gdata/client/blogger_rb.html +122 -0
- data/doc/files/lib/gdata/client/booksearch_rb.html +122 -0
- data/doc/files/lib/gdata/client/calendar_rb.html +122 -0
- data/doc/files/lib/gdata/client/contacts_rb.html +122 -0
- data/doc/files/lib/gdata/client/doclist_rb.html +122 -0
- data/doc/files/lib/gdata/client/finance_rb.html +122 -0
- data/doc/files/lib/gdata/client/gbase_rb.html +122 -0
- data/doc/files/lib/gdata/client/gdata_rb.html +129 -0
- data/doc/files/lib/gdata/client/gmail_rb.html +122 -0
- data/doc/files/lib/gdata/client/health_rb.html +122 -0
- data/doc/files/lib/gdata/client/notebook_rb.html +122 -0
- data/doc/files/lib/gdata/client/photos_rb.html +122 -0
- data/doc/files/lib/gdata/client/spreadsheets_rb.html +122 -0
- data/doc/files/lib/gdata/client/webmaster_tools_rb.html +122 -0
- data/doc/files/lib/gdata/client/youtube_rb.html +122 -0
- data/doc/files/lib/gdata/client_rb.html +144 -0
- data/doc/files/lib/gdata/http/default_service_rb.html +131 -0
- data/doc/files/lib/gdata/http/mime_body_rb.html +122 -0
- data/doc/files/lib/gdata/http/request_rb.html +129 -0
- data/doc/files/lib/gdata/http/response_rb.html +129 -0
- data/doc/files/lib/gdata/http_rb.html +132 -0
- data/doc/files/lib/gdata_rb.html +132 -0
- data/doc/fr_class_index.html +61 -0
- data/doc/fr_file_index.html +53 -0
- data/doc/fr_method_index.html +82 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/gdata19.gemspec +294 -0
- data/lib/gdata/auth/authsub.rb +162 -0
- data/lib/gdata/auth/clientlogin.rb +103 -0
- data/lib/gdata/auth.rb +23 -0
- data/lib/gdata/client/apps.rb +28 -0
- data/lib/gdata/client/base.rb +183 -0
- data/lib/gdata/client/blogger.rb +29 -0
- data/lib/gdata/client/booksearch.rb +29 -0
- data/lib/gdata/client/calendar.rb +59 -0
- data/lib/gdata/client/contacts.rb +29 -0
- data/lib/gdata/client/doclist.rb +29 -0
- data/lib/gdata/client/finance.rb +29 -0
- data/lib/gdata/client/gbase.rb +29 -0
- data/lib/gdata/client/gmail.rb +29 -0
- data/lib/gdata/client/health.rb +29 -0
- data/lib/gdata/client/notebook.rb +29 -0
- data/lib/gdata/client/photos.rb +30 -0
- data/lib/gdata/client/spreadsheets.rb +29 -0
- data/lib/gdata/client/webmaster_tools.rb +29 -0
- data/lib/gdata/client/youtube.rb +48 -0
- data/lib/gdata/client.rb +85 -0
- data/lib/gdata/http/default_service.rb +83 -0
- data/lib/gdata/http/mime_body.rb +101 -0
- data/lib/gdata/http/request.rb +75 -0
- data/lib/gdata/http/response.rb +45 -0
- data/lib/gdata/http.rb +19 -0
- data/lib/gdata.rb +24 -0
- data/pkg/gdata19-1.1.2.gem +0 -0
- data/test/tc_gdata_auth_authsub.rb +53 -0
- data/test/tc_gdata_auth_clientlogin.rb +59 -0
- data/test/tc_gdata_client_base.rb +37 -0
- data/test/tc_gdata_client_calendar.rb +40 -0
- data/test/tc_gdata_client_photos.rb +65 -0
- data/test/tc_gdata_client_youtube.rb +77 -0
- data/test/tc_gdata_http_mime_body.rb +47 -0
- data/test/tc_gdata_http_request.rb +36 -0
- data/test/test_config.yml.example +7 -0
- data/test/test_helper.rb +47 -0
- data/test/testimage.jpg +0 -0
- data/test/ts_gdata.rb +48 -0
- data/test/ts_gdata_auth.rb +25 -0
- data/test/ts_gdata_client.rb +29 -0
- data/test/ts_gdata_http.rb +25 -0
- metadata +320 -0
@@ -0,0 +1,198 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: GData::Client</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">GData::Client</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/gdata/client/apps_rb.html">
|
59
|
+
lib/gdata/client/apps.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
<a href="../../files/lib/gdata/client/base_rb.html">
|
63
|
+
lib/gdata/client/base.rb
|
64
|
+
</a>
|
65
|
+
<br />
|
66
|
+
<a href="../../files/lib/gdata/client/blogger_rb.html">
|
67
|
+
lib/gdata/client/blogger.rb
|
68
|
+
</a>
|
69
|
+
<br />
|
70
|
+
<a href="../../files/lib/gdata/client/booksearch_rb.html">
|
71
|
+
lib/gdata/client/booksearch.rb
|
72
|
+
</a>
|
73
|
+
<br />
|
74
|
+
<a href="../../files/lib/gdata/client/calendar_rb.html">
|
75
|
+
lib/gdata/client/calendar.rb
|
76
|
+
</a>
|
77
|
+
<br />
|
78
|
+
<a href="../../files/lib/gdata/client/contacts_rb.html">
|
79
|
+
lib/gdata/client/contacts.rb
|
80
|
+
</a>
|
81
|
+
<br />
|
82
|
+
<a href="../../files/lib/gdata/client/doclist_rb.html">
|
83
|
+
lib/gdata/client/doclist.rb
|
84
|
+
</a>
|
85
|
+
<br />
|
86
|
+
<a href="../../files/lib/gdata/client/finance_rb.html">
|
87
|
+
lib/gdata/client/finance.rb
|
88
|
+
</a>
|
89
|
+
<br />
|
90
|
+
<a href="../../files/lib/gdata/client/gbase_rb.html">
|
91
|
+
lib/gdata/client/gbase.rb
|
92
|
+
</a>
|
93
|
+
<br />
|
94
|
+
<a href="../../files/lib/gdata/client/gmail_rb.html">
|
95
|
+
lib/gdata/client/gmail.rb
|
96
|
+
</a>
|
97
|
+
<br />
|
98
|
+
<a href="../../files/lib/gdata/client/health_rb.html">
|
99
|
+
lib/gdata/client/health.rb
|
100
|
+
</a>
|
101
|
+
<br />
|
102
|
+
<a href="../../files/lib/gdata/client/notebook_rb.html">
|
103
|
+
lib/gdata/client/notebook.rb
|
104
|
+
</a>
|
105
|
+
<br />
|
106
|
+
<a href="../../files/lib/gdata/client/photos_rb.html">
|
107
|
+
lib/gdata/client/photos.rb
|
108
|
+
</a>
|
109
|
+
<br />
|
110
|
+
<a href="../../files/lib/gdata/client/spreadsheets_rb.html">
|
111
|
+
lib/gdata/client/spreadsheets.rb
|
112
|
+
</a>
|
113
|
+
<br />
|
114
|
+
<a href="../../files/lib/gdata/client/webmaster_tools_rb.html">
|
115
|
+
lib/gdata/client/webmaster_tools.rb
|
116
|
+
</a>
|
117
|
+
<br />
|
118
|
+
<a href="../../files/lib/gdata/client/youtube_rb.html">
|
119
|
+
lib/gdata/client/youtube.rb
|
120
|
+
</a>
|
121
|
+
<br />
|
122
|
+
<a href="../../files/lib/gdata/client_rb.html">
|
123
|
+
lib/gdata/client.rb
|
124
|
+
</a>
|
125
|
+
<br />
|
126
|
+
</td>
|
127
|
+
</tr>
|
128
|
+
|
129
|
+
</table>
|
130
|
+
</div>
|
131
|
+
<!-- banner header -->
|
132
|
+
|
133
|
+
<div id="bodyContent">
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
<div id="contextContent">
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
</div>
|
142
|
+
|
143
|
+
|
144
|
+
</div>
|
145
|
+
|
146
|
+
|
147
|
+
<!-- if includes -->
|
148
|
+
|
149
|
+
<div id="section">
|
150
|
+
|
151
|
+
<div id="class-list">
|
152
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
153
|
+
|
154
|
+
Class <a href="Client/Apps.html" class="link">GData::Client::Apps</a><br />
|
155
|
+
Class <a href="Client/AuthorizationError.html" class="link">GData::Client::AuthorizationError</a><br />
|
156
|
+
Class <a href="Client/BadRequestError.html" class="link">GData::Client::BadRequestError</a><br />
|
157
|
+
Class <a href="Client/Base.html" class="link">GData::Client::Base</a><br />
|
158
|
+
Class <a href="Client/Blogger.html" class="link">GData::Client::Blogger</a><br />
|
159
|
+
Class <a href="Client/BookSearch.html" class="link">GData::Client::BookSearch</a><br />
|
160
|
+
Class <a href="Client/Calendar.html" class="link">GData::Client::Calendar</a><br />
|
161
|
+
Class <a href="Client/CaptchaError.html" class="link">GData::Client::CaptchaError</a><br />
|
162
|
+
Class <a href="Client/Contacts.html" class="link">GData::Client::Contacts</a><br />
|
163
|
+
Class <a href="Client/DocList.html" class="link">GData::Client::DocList</a><br />
|
164
|
+
Class <a href="Client/Error.html" class="link">GData::Client::Error</a><br />
|
165
|
+
Class <a href="Client/Finance.html" class="link">GData::Client::Finance</a><br />
|
166
|
+
Class <a href="Client/GBase.html" class="link">GData::Client::GBase</a><br />
|
167
|
+
Class <a href="Client/GMail.html" class="link">GData::Client::GMail</a><br />
|
168
|
+
Class <a href="Client/Health.html" class="link">GData::Client::Health</a><br />
|
169
|
+
Class <a href="Client/Notebook.html" class="link">GData::Client::Notebook</a><br />
|
170
|
+
Class <a href="Client/Photos.html" class="link">GData::Client::Photos</a><br />
|
171
|
+
Class <a href="Client/RequestError.html" class="link">GData::Client::RequestError</a><br />
|
172
|
+
Class <a href="Client/ServerError.html" class="link">GData::Client::ServerError</a><br />
|
173
|
+
Class <a href="Client/Spreadsheets.html" class="link">GData::Client::Spreadsheets</a><br />
|
174
|
+
Class <a href="Client/UnknownError.html" class="link">GData::Client::UnknownError</a><br />
|
175
|
+
Class <a href="Client/VersionConflictError.html" class="link">GData::Client::VersionConflictError</a><br />
|
176
|
+
Class <a href="Client/WebmasterTools.html" class="link">GData::Client::WebmasterTools</a><br />
|
177
|
+
Class <a href="Client/YouTube.html" class="link">GData::Client::YouTube</a><br />
|
178
|
+
|
179
|
+
</div>
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
<!-- if method_list -->
|
188
|
+
|
189
|
+
|
190
|
+
</div>
|
191
|
+
|
192
|
+
|
193
|
+
<div id="validator-badges">
|
194
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
</body>
|
198
|
+
</html>
|
@@ -0,0 +1,150 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: GData::HTTP::DefaultService</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">GData::HTTP::DefaultService</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/gdata/http/default_service_rb.html">
|
59
|
+
lib/gdata/http/default_service.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
<div id="description">
|
82
|
+
<p>
|
83
|
+
This is the default implementation of the <a href="../HTTP.html">HTTP</a>
|
84
|
+
layer that uses Net::HTTP. You could roll your own if you have different
|
85
|
+
requirements or cannot use Net::HTTP for some reason.
|
86
|
+
</p>
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
</div>
|
92
|
+
|
93
|
+
<div id="method-list">
|
94
|
+
<h3 class="section-bar">Methods</h3>
|
95
|
+
|
96
|
+
<div class="name-list">
|
97
|
+
<a href="#M000046">make_request</a>
|
98
|
+
</div>
|
99
|
+
</div>
|
100
|
+
|
101
|
+
</div>
|
102
|
+
|
103
|
+
|
104
|
+
<!-- if includes -->
|
105
|
+
|
106
|
+
<div id="section">
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
<!-- if method_list -->
|
116
|
+
<div id="methods">
|
117
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
118
|
+
|
119
|
+
<div id="method-M000046" class="method-detail">
|
120
|
+
<a name="M000046"></a>
|
121
|
+
|
122
|
+
<div class="method-heading">
|
123
|
+
<a href="DefaultService.src/M000046.html" target="Code" class="method-signature"
|
124
|
+
onclick="popupCode('DefaultService.src/M000046.html');return false;">
|
125
|
+
<span class="method-name">make_request</span><span class="method-args">(request)</span>
|
126
|
+
</a>
|
127
|
+
</div>
|
128
|
+
|
129
|
+
<div class="method-description">
|
130
|
+
<p>
|
131
|
+
Take a <a href="Request.html">GData::HTTP::Request</a>, execute the
|
132
|
+
request, and return a <a href="Response.html">GData::HTTP::Response</a>
|
133
|
+
object.
|
134
|
+
</p>
|
135
|
+
</div>
|
136
|
+
</div>
|
137
|
+
|
138
|
+
|
139
|
+
</div>
|
140
|
+
|
141
|
+
|
142
|
+
</div>
|
143
|
+
|
144
|
+
|
145
|
+
<div id="validator-badges">
|
146
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
147
|
+
</div>
|
148
|
+
|
149
|
+
</body>
|
150
|
+
</html>
|
@@ -0,0 +1,48 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>make_request (GData::HTTP::DefaultService)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/gdata/http/default_service.rb, line 29</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">make_request</span>(<span class="ruby-identifier">request</span>)
|
15
|
+
<span class="ruby-identifier">url</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">request</span>.<span class="ruby-identifier">url</span>)
|
16
|
+
<span class="ruby-identifier">http</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">host</span>, <span class="ruby-identifier">url</span>.<span class="ruby-identifier">port</span>)
|
17
|
+
<span class="ruby-identifier">http</span>.<span class="ruby-identifier">use_ssl</span> = (<span class="ruby-identifier">url</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'https'</span>)
|
18
|
+
<span class="ruby-identifier">http</span>.<span class="ruby-identifier">verify_mode</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">SSL</span><span class="ruby-operator">::</span><span class="ruby-constant">VERIFY_NONE</span>
|
19
|
+
|
20
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">method</span>
|
21
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:get</span>
|
22
|
+
<span class="ruby-identifier">req</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Get</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">request_uri</span>)
|
23
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:put</span>
|
24
|
+
<span class="ruby-identifier">req</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Put</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">request_uri</span>)
|
25
|
+
<span class="ruby-identifier">request</span>.<span class="ruby-identifier">calculate_length!</span>
|
26
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:post</span>
|
27
|
+
<span class="ruby-identifier">req</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Post</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">request_uri</span>)
|
28
|
+
<span class="ruby-identifier">request</span>.<span class="ruby-identifier">calculate_length!</span>
|
29
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:delete</span>
|
30
|
+
<span class="ruby-identifier">req</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Delete</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">request_uri</span>)
|
31
|
+
<span class="ruby-keyword kw">else</span>
|
32
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"Unsupported HTTP method specified."</span>
|
33
|
+
<span class="ruby-keyword kw">end</span>
|
34
|
+
|
35
|
+
<span class="ruby-identifier">req</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span>
|
36
|
+
<span class="ruby-identifier">request</span>.<span class="ruby-identifier">headers</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
37
|
+
<span class="ruby-identifier">req</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span>
|
38
|
+
<span class="ruby-keyword kw">end</span>
|
39
|
+
<span class="ruby-identifier">res</span> = <span class="ruby-identifier">http</span>.<span class="ruby-identifier">request</span>(<span class="ruby-identifier">req</span>)
|
40
|
+
|
41
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-constant">Response</span>.<span class="ruby-identifier">new</span>
|
42
|
+
<span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">res</span>.<span class="ruby-identifier">body</span>
|
43
|
+
<span class="ruby-identifier">response</span>.<span class="ruby-identifier">headers</span> = <span class="ruby-identifier">res</span>.<span class="ruby-identifier">header</span>.<span class="ruby-identifier">to_hash</span>
|
44
|
+
<span class="ruby-identifier">response</span>.<span class="ruby-identifier">status_code</span> = <span class="ruby-identifier">res</span>.<span class="ruby-identifier">code</span>.<span class="ruby-identifier">to_i</span>
|
45
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
46
|
+
<span class="ruby-keyword kw">end</span></pre>
|
47
|
+
</body>
|
48
|
+
</html>
|
@@ -0,0 +1,63 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>make_request (GData::HTTP::DefaultService)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/gdata/http/default_service.rb, line 29</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">make_request</span>(<span class="ruby-identifier">request</span>)
|
15
|
+
<span class="ruby-identifier">url</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">request</span>.<span class="ruby-identifier">url</span>)
|
16
|
+
<span class="ruby-identifier">http</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">host</span>, <span class="ruby-identifier">url</span>.<span class="ruby-identifier">port</span>)
|
17
|
+
<span class="ruby-identifier">http</span>.<span class="ruby-identifier">use_ssl</span> = (<span class="ruby-identifier">url</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'https'</span>)
|
18
|
+
<span class="ruby-identifier">http</span>.<span class="ruby-identifier">verify_mode</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">SSL</span><span class="ruby-operator">::</span><span class="ruby-constant">VERIFY_NONE</span>
|
19
|
+
|
20
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">method</span>
|
21
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:get</span>
|
22
|
+
<span class="ruby-identifier">req</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Get</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">request_uri</span>)
|
23
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:put</span>
|
24
|
+
<span class="ruby-identifier">req</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Put</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">request_uri</span>)
|
25
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:post</span>
|
26
|
+
<span class="ruby-identifier">req</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Post</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">request_uri</span>)
|
27
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:delete</span>
|
28
|
+
<span class="ruby-identifier">req</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Delete</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">request_uri</span>)
|
29
|
+
<span class="ruby-keyword kw">else</span>
|
30
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"Unsupported HTTP method specified."</span>
|
31
|
+
<span class="ruby-keyword kw">end</span>
|
32
|
+
|
33
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span>
|
34
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">String</span>
|
35
|
+
<span class="ruby-identifier">req</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span>
|
36
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">Hash</span>
|
37
|
+
<span class="ruby-identifier">req</span>.<span class="ruby-identifier">set_form_data</span>(<span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span>)
|
38
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">File</span>
|
39
|
+
<span class="ruby-identifier">req</span>.<span class="ruby-identifier">body_stream</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span>
|
40
|
+
<span class="ruby-identifier">request</span>.<span class="ruby-identifier">chunked</span> = <span class="ruby-keyword kw">true</span>
|
41
|
+
<span class="ruby-keyword kw">else</span>
|
42
|
+
<span class="ruby-identifier">req</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">to_s</span>
|
43
|
+
<span class="ruby-keyword kw">end</span>
|
44
|
+
|
45
|
+
<span class="ruby-identifier">request</span>.<span class="ruby-identifier">headers</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
46
|
+
<span class="ruby-identifier">req</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span>
|
47
|
+
<span class="ruby-keyword kw">end</span>
|
48
|
+
|
49
|
+
<span class="ruby-identifier">request</span>.<span class="ruby-identifier">calculate_length!</span>
|
50
|
+
|
51
|
+
<span class="ruby-identifier">res</span> = <span class="ruby-identifier">http</span>.<span class="ruby-identifier">request</span>(<span class="ruby-identifier">req</span>)
|
52
|
+
|
53
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-constant">Response</span>.<span class="ruby-identifier">new</span>
|
54
|
+
<span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">res</span>.<span class="ruby-identifier">body</span>
|
55
|
+
<span class="ruby-identifier">response</span>.<span class="ruby-identifier">headers</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
|
56
|
+
<span class="ruby-identifier">res</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
57
|
+
<span class="ruby-identifier">response</span>.<span class="ruby-identifier">headers</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span>
|
58
|
+
<span class="ruby-keyword kw">end</span>
|
59
|
+
<span class="ruby-identifier">response</span>.<span class="ruby-identifier">status_code</span> = <span class="ruby-identifier">res</span>.<span class="ruby-identifier">code</span>.<span class="ruby-identifier">to_i</span>
|
60
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
61
|
+
<span class="ruby-keyword kw">end</span></pre>
|
62
|
+
</body>
|
63
|
+
</html>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>make_request (GData::HTTP::DefaultService)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/gdata/http/default_service.rb, line 29</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">make_request</span>(<span class="ruby-identifier">request</span>)
|
15
|
+
<span class="ruby-identifier">url</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">request</span>.<span class="ruby-identifier">url</span>)
|
16
|
+
<span class="ruby-identifier">http</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">host</span>, <span class="ruby-identifier">url</span>.<span class="ruby-identifier">port</span>)
|
17
|
+
<span class="ruby-identifier">http</span>.<span class="ruby-identifier">use_ssl</span> = (<span class="ruby-identifier">url</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'https'</span>)
|
18
|
+
<span class="ruby-identifier">http</span>.<span class="ruby-identifier">verify_mode</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">SSL</span><span class="ruby-operator">::</span><span class="ruby-constant">VERIFY_NONE</span>
|
19
|
+
|
20
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">method</span>
|
21
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:get</span>
|
22
|
+
<span class="ruby-identifier">req</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Get</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">request_uri</span>)
|
23
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:put</span>
|
24
|
+
<span class="ruby-identifier">req</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Put</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">request_uri</span>)
|
25
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:post</span>
|
26
|
+
<span class="ruby-identifier">req</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Post</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">request_uri</span>)
|
27
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:delete</span>
|
28
|
+
<span class="ruby-identifier">req</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Delete</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">request_uri</span>)
|
29
|
+
<span class="ruby-keyword kw">else</span>
|
30
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"Unsupported HTTP method specified."</span>
|
31
|
+
<span class="ruby-keyword kw">end</span>
|
32
|
+
|
33
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span>
|
34
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">String</span>
|
35
|
+
<span class="ruby-identifier">req</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span>
|
36
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">Hash</span>
|
37
|
+
<span class="ruby-identifier">req</span>.<span class="ruby-identifier">set_form_data</span>(<span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span>)
|
38
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">File</span>
|
39
|
+
<span class="ruby-identifier">req</span>.<span class="ruby-identifier">body_stream</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span>
|
40
|
+
<span class="ruby-identifier">request</span>.<span class="ruby-identifier">chunked</span> = <span class="ruby-keyword kw">true</span>
|
41
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">GData</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">MimeBody</span>
|
42
|
+
<span class="ruby-identifier">req</span>.<span class="ruby-identifier">body_stream</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span>
|
43
|
+
<span class="ruby-identifier">request</span>.<span class="ruby-identifier">chunked</span> = <span class="ruby-keyword kw">true</span>
|
44
|
+
<span class="ruby-keyword kw">else</span>
|
45
|
+
<span class="ruby-identifier">req</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">to_s</span>
|
46
|
+
<span class="ruby-keyword kw">end</span>
|
47
|
+
|
48
|
+
<span class="ruby-identifier">request</span>.<span class="ruby-identifier">headers</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
49
|
+
<span class="ruby-identifier">req</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span>
|
50
|
+
<span class="ruby-keyword kw">end</span>
|
51
|
+
|
52
|
+
<span class="ruby-identifier">request</span>.<span class="ruby-identifier">calculate_length!</span>
|
53
|
+
|
54
|
+
<span class="ruby-identifier">res</span> = <span class="ruby-identifier">http</span>.<span class="ruby-identifier">request</span>(<span class="ruby-identifier">req</span>)
|
55
|
+
|
56
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-constant">Response</span>.<span class="ruby-identifier">new</span>
|
57
|
+
<span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">res</span>.<span class="ruby-identifier">body</span>
|
58
|
+
<span class="ruby-identifier">response</span>.<span class="ruby-identifier">headers</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
|
59
|
+
<span class="ruby-identifier">res</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
60
|
+
<span class="ruby-identifier">response</span>.<span class="ruby-identifier">headers</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span>
|
61
|
+
<span class="ruby-keyword kw">end</span>
|
62
|
+
<span class="ruby-identifier">response</span>.<span class="ruby-identifier">status_code</span> = <span class="ruby-identifier">res</span>.<span class="ruby-identifier">code</span>.<span class="ruby-identifier">to_i</span>
|
63
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
64
|
+
<span class="ruby-keyword kw">end</span></pre>
|
65
|
+
</body>
|
66
|
+
</html>
|