Source

cappuccino-docs / cappuccino docs / cappuccino.org / learn / documentation / _c_p_u_r_l_connection_8j_source.html

Full commit
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<!-- Mirrored from cappuccino.org/learn/documentation/_c_p_u_r_l_connection_8j_source.html by HTTrack Website Copier/3.x [XR&CO'2006], Mon, 20 Sep 2010 02:19:31 GMT -->
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Cappuccino API: Foundation/CPURLConnection.j Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>Foundation/CPURLConnection.j</h1><a href="_c_p_u_r_l_connection_8j.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * CPURLConnection.j</span>
<a name="l00003"></a>00003 <span class="comment"> * Foundation</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * Created by Francisco Tolmasky.</span>
<a name="l00006"></a>00006 <span class="comment"> * Copyright 2008, 280 North, Inc.</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> * This library is free software; you can redistribute it and/or</span>
<a name="l00009"></a>00009 <span class="comment"> * modify it under the terms of the GNU Lesser General Public</span>
<a name="l00010"></a>00010 <span class="comment"> * License as published by the Free Software Foundation; either</span>
<a name="l00011"></a>00011 <span class="comment"> * version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00012"></a>00012 <span class="comment"> *</span>
<a name="l00013"></a>00013 <span class="comment"> * This library is distributed in the hope that it will be useful,</span>
<a name="l00014"></a>00014 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00015"></a>00015 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>
<a name="l00016"></a>00016 <span class="comment"> * Lesser General Public License for more details.</span>
<a name="l00017"></a>00017 <span class="comment"> *</span>
<a name="l00018"></a>00018 <span class="comment"> * You should have received a copy of the GNU Lesser General Public</span>
<a name="l00019"></a>00019 <span class="comment"> * License along with this library; if not, write to the Free Software</span>
<a name="l00020"></a>00020 <span class="comment"> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022 
<a name="l00023"></a>00023 @<span class="keyword">import</span> <span class="stringliteral">&quot;CPObject.j&quot;</span>
<a name="l00024"></a>00024 @<span class="keyword">import</span> <span class="stringliteral">&quot;CPRunLoop.j&quot;</span>
<a name="l00025"></a>00025 @<span class="keyword">import</span> <span class="stringliteral">&quot;CPURLRequest.j&quot;</span>
<a name="l00026"></a>00026 @<span class="keyword">import</span> <span class="stringliteral">&quot;CPURLResponse.j&quot;</span>
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 
<a name="l00029"></a><a class="code" href="_c_p_u_r_l_connection_8j.html#a1c0ccf98ec6b9deca39c5dc14d7ad741">00029</a> var <a class="code" href="_c_p_u_r_l_connection_8j.html#a1c0ccf98ec6b9deca39c5dc14d7ad741">CPURLConnectionDelegate</a> = nil;
<a name="l00030"></a>00030 
<a name="l00075"></a><a class="code" href="class_c_p_u_r_l_connection.html">00075</a> <span class="keyword">@implementation </span><a class="code" href="class_c_p_u_r_l_connection.html" title="Provides loading of a URL request.">CPURLConnection</a> : <a class="code" href="class_c_p_object.html" title="The root class from which most classes are subclassed.">CPObject</a>
<a name="l00076"></a>00076 {
<a name="l00077"></a>00077     <a class="code" href="class_c_p_u_r_l_request.html" title="Contains data obtained during a request made with CPURLConnection.">CPURLRequest</a>    _request;
<a name="l00078"></a>00078     <span class="keywordtype">id</span>              _delegate;
<a name="l00079"></a>00079     BOOL            _isCanceled;
<a name="l00080"></a>00080     BOOL            _isLocalFileConnection;
<a name="l00081"></a>00081 
<a name="l00082"></a>00082     HTTPRequest     _HTTPRequest;
<a name="l00083"></a>00083 }
<a name="l00084"></a>00084 
<a name="l00085"></a><a class="code" href="class_c_p_u_r_l_connection.html#ab5880c5dac87a2a8e64a2fb32f9e5ae1">00085</a> + (void)setClassDelegate:(<span class="keywordtype">id</span>)delegate
<a name="l00086"></a>00086 {
<a name="l00087"></a>00087     <a class="code" href="_c_p_u_r_l_connection_8j.html#a1c0ccf98ec6b9deca39c5dc14d7ad741">CPURLConnectionDelegate</a> = delegate;
<a name="l00088"></a>00088 }
<a name="l00089"></a>00089 
<a name="l00090"></a>00090 <span class="comment">/*</span>
<a name="l00091"></a>00091 <span class="comment">    Sends a request for the data from a URL. This is the easiest way to obtain data from a URL.</span>
<a name="l00092"></a>00092 <span class="comment">    @param aRequest contains the URL to request the data from</span>
<a name="l00093"></a>00093 <span class="comment">    @param aURLResponse not used</span>
<a name="l00094"></a>00094 <span class="comment">    @param anError not used</span>
<a name="l00095"></a>00095 <span class="comment">    @return the data at the URL or \c nil if there was an error</span>
<a name="l00096"></a>00096 <span class="comment">*/</span>
<a name="l00097"></a><a class="code" href="class_c_p_u_r_l_connection.html#a4394c3d304879abe53ac3963df98b018">00097</a> + (<a class="code" href="class_c_p_data.html" title="A Cappuccino wrapper for any data type.">CPData</a>)sendSynchronousRequest:(<a class="code" href="class_c_p_u_r_l_request.html" title="Contains data obtained during a request made with CPURLConnection.">CPURLRequest</a>)aRequest returningResponse:({<a class="code" href="class_c_p_u_r_l_response.html" title="Protocol agnostic information about a request to a specifc URL.">CPURLResponse</a>})aURLResponse
<a name="l00098"></a>00098 {
<a name="l00099"></a>00099     <span class="keywordflow">try</span>
<a name="l00100"></a>00100     {
<a name="l00101"></a>00101         var request = <span class="keyword">new</span> CFHTTPRequest();
<a name="l00102"></a>00102 
<a name="l00103"></a>00103         request.open([aRequest HTTPMethod], [[aRequest URL] absoluteString], NO);
<a name="l00104"></a>00104 
<a name="l00105"></a>00105         var fields = [aRequest <a class="code" href="class_c_p_u_r_l_request.html#a964778231a51f9bac5bf4329506f80fb">allHTTPHeaderFields</a>],
<a name="l00106"></a>00106             key = nil,
<a name="l00107"></a>00107             keys = [fields keyEnumerator];
<a name="l00108"></a>00108 
<a name="l00109"></a>00109         <span class="keywordflow">while</span> (key = [keys nextObject])
<a name="l00110"></a>00110             request.setRequestHeader(key, [fields objectForKey:key]);
<a name="l00111"></a>00111 
<a name="l00112"></a>00112         request.send([aRequest HTTPBody]);
<a name="l00113"></a>00113 
<a name="l00114"></a>00114         <span class="keywordflow">return</span> [<a class="code" href="class_c_p_data.html" title="A Cappuccino wrapper for any data type.">CPData</a> <a class="code" href="class_c_p_data.html#aa20e2280ce65812b0c88dff49ea3fb7a">dataWithRawString</a>:request.responseText()];
<a name="l00115"></a>00115     }
<a name="l00116"></a>00116     <span class="keywordflow">catch</span> (anException)
<a name="l00117"></a>00117     {
<a name="l00118"></a>00118     }
<a name="l00119"></a>00119     
<a name="l00120"></a>00120     <span class="keywordflow">return</span> nil;
<a name="l00121"></a>00121 }
<a name="l00122"></a>00122 
<a name="l00123"></a>00123 <span class="comment">/*</span>
<a name="l00124"></a>00124 <span class="comment">    Creates a url connection with a delegate to monitor the request progress.</span>
<a name="l00125"></a>00125 <span class="comment">    @param aRequest contains the URL to obtain data from</span>
<a name="l00126"></a>00126 <span class="comment">    @param aDelegate will be sent messages related to the request progress</span>
<a name="l00127"></a>00127 <span class="comment">    @return a connection that can be \c started to initiate the request</span>
<a name="l00128"></a>00128 <span class="comment">*/</span>
<a name="l00129"></a><a class="code" href="class_c_p_u_r_l_connection.html#a5f38828bd714d6b9eca92551ae1d9468">00129</a> + (<a class="code" href="class_c_p_u_r_l_connection.html" title="Provides loading of a URL request.">CPURLConnection</a>)connectionWithRequest:(<a class="code" href="class_c_p_u_r_l_request.html" title="Contains data obtained during a request made with CPURLConnection.">CPURLRequest</a>)aRequest delegate:(<span class="keywordtype">id</span>)aDelegate
<a name="l00130"></a>00130 {
<a name="l00131"></a>00131     <span class="keywordflow">return</span> [[<span class="keyword">self</span> alloc] initWithRequest:aRequest delegate:aDelegate];
<a name="l00132"></a>00132 }
<a name="l00133"></a>00133 
<a name="l00134"></a>00134 <span class="comment">/*</span>
<a name="l00135"></a>00135 <span class="comment">    Default class initializer. Use one of the class methods instead.</span>
<a name="l00136"></a>00136 <span class="comment">    @param aRequest contains the URL to contact</span>
<a name="l00137"></a>00137 <span class="comment">    @param aDelegate will receive progress messages</span>
<a name="l00138"></a>00138 <span class="comment">    @param shouldStartImmediately whether the \c -start method should be called from here</span>
<a name="l00139"></a>00139 <span class="comment">    @return the initialized url connection</span>
<a name="l00140"></a>00140 <span class="comment">*/</span>
<a name="l00141"></a><a class="code" href="class_c_p_u_r_l_connection.html#a62293797eb2dc211d147ab826c3e71b2">00141</a> - (id)initWithRequest:(<a class="code" href="class_c_p_u_r_l_request.html" title="Contains data obtained during a request made with CPURLConnection.">CPURLRequest</a>)aRequest delegate:(<span class="keywordtype">id</span>)aDelegate startImmediately:(BOOL)shouldStartImmediately
<a name="l00142"></a>00142 {
<a name="l00143"></a>00143     <span class="keyword">self</span> = [<span class="keyword">super</span> init];
<a name="l00144"></a>00144     
<a name="l00145"></a>00145     <span class="keywordflow">if</span> (<span class="keyword">self</span>)
<a name="l00146"></a>00146     {
<a name="l00147"></a>00147         _request = aRequest;
<a name="l00148"></a>00148         _delegate = aDelegate;
<a name="l00149"></a>00149         _isCanceled = NO;
<a name="l00150"></a>00150         
<a name="l00151"></a>00151         var URL = [_request URL],
<a name="l00152"></a>00152             scheme = [URL scheme];
<a name="l00153"></a>00153 
<a name="l00154"></a>00154         <span class="comment">// Browsers use &quot;file:&quot;, Titanium uses &quot;app:&quot;</span>
<a name="l00155"></a>00155         _isLocalFileConnection =    scheme === <span class="stringliteral">&quot;file&quot;</span> ||
<a name="l00156"></a>00156                                     ((scheme === <span class="stringliteral">&quot;http&quot;</span> || scheme === <span class="stringliteral">&quot;https:&quot;</span>) &amp;&amp;
<a name="l00157"></a>00157                                     window.location &amp;&amp;
<a name="l00158"></a>00158                                     (window.location.protocol === <span class="stringliteral">&quot;file:&quot;</span> || window.location.protocol === <span class="stringliteral">&quot;app:&quot;</span>));
<a name="l00159"></a>00159 
<a name="l00160"></a>00160         _HTTPRequest = <span class="keyword">new</span> CFHTTPRequest();
<a name="l00161"></a>00161 
<a name="l00162"></a>00162         <span class="keywordflow">if</span> (shouldStartImmediately)
<a name="l00163"></a>00163             [<span class="keyword">self</span> <a class="code" href="class_c_p_u_r_l_connection.html#a14205617fa4da2200b76d1f4d87a2d23">start</a>];
<a name="l00164"></a>00164     }
<a name="l00165"></a>00165 
<a name="l00166"></a>00166     <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00167"></a>00167 }
<a name="l00168"></a>00168 
<a name="l00169"></a><a class="code" href="class_c_p_u_r_l_connection.html#aecfa22f8c95edc6d5022117f7578026b">00169</a> - (id)initWithRequest:(<a class="code" href="class_c_p_u_r_l_request.html" title="Contains data obtained during a request made with CPURLConnection.">CPURLRequest</a>)aRequest delegate:(<span class="keywordtype">id</span>)aDelegate
<a name="l00170"></a>00170 {
<a name="l00171"></a>00171     <span class="keywordflow">return</span> [<span class="keyword">self</span> <a class="code" href="class_c_p_u_r_l_connection.html#a62293797eb2dc211d147ab826c3e71b2">initWithRequest</a>:aRequest <a class="code" href="class_c_p_u_r_l_connection.html#a62293797eb2dc211d147ab826c3e71b2">delegate</a>:aDelegate <a class="code" href="class_c_p_u_r_l_connection.html#a62293797eb2dc211d147ab826c3e71b2">startImmediately</a>:YES];
<a name="l00172"></a>00172 }
<a name="l00173"></a>00173 
<a name="l00174"></a>00174 <span class="comment">/*</span>
<a name="l00175"></a>00175 <span class="comment">    return the delegate</span>
<a name="l00176"></a>00176 <span class="comment">*/</span>
<a name="l00177"></a><a class="code" href="class_c_p_u_r_l_connection.html#a64b355907daa70fc2a0b6bbc01ce65fd">00177</a> - (id)delegate
<a name="l00178"></a>00178 {
<a name="l00179"></a>00179     <span class="keywordflow">return</span> _delegate;
<a name="l00180"></a>00180 }
<a name="l00181"></a>00181 
<a name="l00182"></a>00182 <span class="comment">/*</span>
<a name="l00183"></a>00183 <span class="comment">    Start the connection. Not needed if you used the class method +connectionWithRequest:delegate:</span>
<a name="l00184"></a>00184 <span class="comment">*/</span>
<a name="l00185"></a><a class="code" href="class_c_p_u_r_l_connection.html#a14205617fa4da2200b76d1f4d87a2d23">00185</a> - (void)start
<a name="l00186"></a>00186 {
<a name="l00187"></a>00187     _isCanceled = NO;
<a name="l00188"></a>00188 
<a name="l00189"></a>00189     <span class="keywordflow">try</span>
<a name="l00190"></a>00190     {   
<a name="l00191"></a>00191         _HTTPRequest.open([_request HTTPMethod], [[_request URL] absoluteString], YES);
<a name="l00192"></a>00192 
<a name="l00193"></a>00193         _HTTPRequest.onreadystatechange = function() { [<span class="keyword">self</span> _readyStateDidChange]; }
<a name="l00194"></a>00194 
<a name="l00195"></a>00195         var fields = [_request allHTTPHeaderFields],
<a name="l00196"></a>00196             key = nil,
<a name="l00197"></a>00197             keys = [fields keyEnumerator];
<a name="l00198"></a>00198 
<a name="l00199"></a>00199         <span class="keywordflow">while</span> (key = [keys nextObject])
<a name="l00200"></a>00200             _HTTPRequest.setRequestHeader(key, [fields objectForKey:key]);
<a name="l00201"></a>00201 
<a name="l00202"></a>00202         _HTTPRequest.send([_request HTTPBody]);
<a name="l00203"></a>00203     }
<a name="l00204"></a>00204     <span class="keywordflow">catch</span> (anException)
<a name="l00205"></a>00205     {
<a name="l00206"></a>00206         <span class="keywordflow">if</span> ([_delegate respondsToSelector:<span class="keyword">@selector</span>(connection:didFailWithError:)])
<a name="l00207"></a>00207             [_delegate connection:self didFailWithError:anException];
<a name="l00208"></a>00208     }
<a name="l00209"></a>00209 }
<a name="l00210"></a>00210 
<a name="l00211"></a>00211 <span class="comment">/*</span>
<a name="l00212"></a>00212 <span class="comment">    Cancels the current request.</span>
<a name="l00213"></a>00213 <span class="comment">*/</span>
<a name="l00214"></a><a class="code" href="class_c_p_u_r_l_connection.html#aea5796f30cbb18972c7f183d8126c446">00214</a> - (void)cancel
<a name="l00215"></a>00215 {
<a name="l00216"></a>00216     _isCanceled = YES;
<a name="l00217"></a>00217     
<a name="l00218"></a>00218     <span class="keywordflow">try</span>
<a name="l00219"></a>00219     {
<a name="l00220"></a>00220         _HTTPRequest.abort();
<a name="l00221"></a>00221     }
<a name="l00222"></a>00222     <span class="comment">// We expect an exception in some browsers like FireFox.</span>
<a name="l00223"></a>00223     <span class="keywordflow">catch</span> (anException)
<a name="l00224"></a>00224     {
<a name="l00225"></a>00225     }
<a name="l00226"></a>00226 }
<a name="l00227"></a>00227 
<a name="l00228"></a><a class="code" href="class_c_p_u_r_l_connection.html#a437cae36f68a1cb5bd7c0c6a0dcbcea1">00228</a> - (BOOL)isLocalFileConnection
<a name="l00229"></a>00229 {
<a name="l00230"></a>00230     <span class="keywordflow">return</span> _isLocalFileConnection;
<a name="l00231"></a>00231 }
<a name="l00232"></a>00232 
<a name="l00233"></a>00233 <span class="comment">/* @ignore */</span>
<a name="l00234"></a>00234 - (void)_readyStateDidChange
<a name="l00235"></a>00235 {
<a name="l00236"></a>00236     <span class="keywordflow">if</span> (_HTTPRequest.readyState() === CFHTTPRequest.CompleteState)
<a name="l00237"></a>00237     {
<a name="l00238"></a>00238         var statusCode = _HTTPRequest.status(),
<a name="l00239"></a>00239             URL = [_request URL];
<a name="l00240"></a>00240 
<a name="l00241"></a>00241         <span class="keywordflow">if</span> ([_delegate respondsToSelector:<span class="keyword">@selector</span>(connection:didReceiveResponse:)])
<a name="l00242"></a>00242         {
<a name="l00243"></a>00243             <span class="keywordflow">if</span> (_isLocalFileConnection)
<a name="l00244"></a>00244                 [_delegate connection:self didReceiveResponse:[[<a class="code" href="class_c_p_u_r_l_response.html" title="Protocol agnostic information about a request to a specifc URL.">CPURLResponse</a> alloc] initWithURL:URL]];
<a name="l00245"></a>00245             <span class="keywordflow">else</span>
<a name="l00246"></a>00246             {
<a name="l00247"></a>00247                 var response = [[<a class="code" href="class_c_p_h_t_t_p_u_r_l_response.html">CPHTTPURLResponse</a> alloc] initWithURL:URL];
<a name="l00248"></a>00248 
<a name="l00249"></a>00249                 [response _setStatusCode:statusCode];
<a name="l00250"></a>00250 
<a name="l00251"></a>00251                 [_delegate connection:self didReceiveResponse:response];
<a name="l00252"></a>00252             }
<a name="l00253"></a>00253         }
<a name="l00254"></a>00254         <span class="keywordflow">if</span> (!_isCanceled)
<a name="l00255"></a>00255         {
<a name="l00256"></a>00256             <span class="keywordflow">if</span> (statusCode === 401 &amp;&amp; [<a class="code" href="_c_p_u_r_l_connection_8j.html#a1c0ccf98ec6b9deca39c5dc14d7ad741">CPURLConnectionDelegate</a> respondsToSelector:<span class="keyword">@selector</span>(connectionDidReceiveAuthenticationChallenge:)])
<a name="l00257"></a>00257                 [CPURLConnectionDelegate connectionDidReceiveAuthenticationChallenge:self];
<a name="l00258"></a>00258             <span class="keywordflow">else</span>
<a name="l00259"></a>00259             {
<a name="l00260"></a>00260                 <span class="keywordflow">if</span> ([_delegate respondsToSelector:<span class="keyword">@selector</span>(connection:didReceiveData:)])
<a name="l00261"></a>00261                     [_delegate connection:self didReceiveData:_HTTPRequest.responseText()];
<a name="l00262"></a>00262                 <span class="keywordflow">if</span> ([_delegate respondsToSelector:<span class="keyword">@selector</span>(connectionDidFinishLoading:)])
<a name="l00263"></a>00263                     [_delegate connectionDidFinishLoading:self];
<a name="l00264"></a>00264             }
<a name="l00265"></a>00265         }
<a name="l00266"></a>00266     }
<a name="l00267"></a>00267 
<a name="l00268"></a>00268     [[<a class="code" href="class_c_p_run_loop.html" title="The main run loop for the application.">CPRunLoop</a> <a class="code" href="class_c_p_run_loop.html#aba93f1cef957bad4353ce060981c0b9d">currentRunLoop</a>] <a class="code" href="class_c_p_run_loop.html#aad8e51e44d4c17634d8c45c1ca540217">limitDateForMode</a>:CPDefaultRunLoopMode];
<a name="l00269"></a>00269 }
<a name="l00270"></a>00270 
<a name="l00271"></a>00271 <span class="comment">/* @ignore */</span>
<a name="l00272"></a>00272 - (HTTPRequest)_HTTPRequest
<a name="l00273"></a>00273 {
<a name="l00274"></a>00274     <span class="keywordflow">return</span> _HTTPRequest;
<a name="l00275"></a>00275 }
<a name="l00276"></a>00276 
<a name="l00277"></a>00277 <span class="keyword">@end</span>
<a name="l00278"></a>00278 
<a name="l00279"></a>00279 <span class="keyword">@implementation </span><a class="code" href="class_c_p_u_r_l_connection.html" title="Provides loading of a URL request.">CPURLConnection</a> (Deprecated)
<a name="l00280"></a>00280 
<a name="l00281"></a><a class="code" href="class_c_p_u_r_l_connection.html#a16a405c56b16434bff50134b45105c11">00281</a> + (<a class="code" href="class_c_p_data.html" title="A Cappuccino wrapper for any data type.">CPData</a>)sendSynchronousRequest:(<a class="code" href="class_c_p_u_r_l_request.html" title="Contains data obtained during a request made with CPURLConnection.">CPURLRequest</a>)aRequest returningResponse:({<a class="code" href="class_c_p_u_r_l_response.html" title="Protocol agnostic information about a request to a specifc URL.">CPURLResponse</a>})aURLResponse error:(<span class="keywordtype">id</span>)anError
<a name="l00282"></a>00282 {
<a name="l00283"></a>00283     _CPReportLenientDeprecation(<span class="keyword">self</span>, _cmd, <span class="keyword">@selector</span>(sendSynchronousRequest:returningResponse:));
<a name="l00284"></a>00284 
<a name="l00285"></a>00285     <span class="keywordflow">return</span> [<span class="keyword">self</span> <a class="code" href="class_c_p_u_r_l_connection.html#a4394c3d304879abe53ac3963df98b018">sendSynchronousRequest</a>:aRequest <a class="code" href="class_c_p_u_r_l_connection.html#a4394c3d304879abe53ac3963df98b018">returningResponse</a>:aURLResponse];
<a name="l00286"></a>00286 }
<a name="l00287"></a>00287 
<a name="l00288"></a>00288 - (HTTPRequest)_XMLHTTPRequest
<a name="l00289"></a>00289 {
<a name="l00290"></a>00290     _CPReportLenientDeprecation(<span class="keyword">self</span>, _cmd, <span class="keyword">@selector</span>(_HTTPRequest));
<a name="l00291"></a>00291 
<a name="l00292"></a>00292     <span class="keywordflow">return</span> [<span class="keyword">self</span> _HTTPRequest];
<a name="l00293"></a>00293 }
<a name="l00294"></a>00294 
<a name="l00295"></a>00295 <span class="keyword">@end</span>
</pre></div></div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Tue Apr 6 10:32:57 2010 for Cappuccino API by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>

<!-- Mirrored from cappuccino.org/learn/documentation/_c_p_u_r_l_connection_8j_source.html by HTTrack Website Copier/3.x [XR&CO'2006], Mon, 20 Sep 2010 02:19:31 GMT -->
</html>