ios - 这个 Web 服务调用代码是什么,到底发生了什么?
<p><div>
<aside class="s-notice s-notice__info post-notice js-post-notice mb16"role="status">
<div class="d-flex fd-column fw-nowrap">
<div class="d-flex fw-nowrap">
<div class="flex--item wmn0 fl1 lh-lg">
<div class="flex--item fl1 lh-lg">
<b>关闭</b>。这个问题需要<a href="https://stackoverflow.com/help/closed-questions" rel="noreferrer noopener nofollow">details or clarity</a> .它目前不接受答案。
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>作为 <a href="https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/#//apple_ref/occ/clm/NSURLConnection/sendAsynchronousRequest:queue:completionHandler:" rel="noreferrer noopener nofollow">the documentation</a>说,</p>
<blockquote>
<h1>Parameters</h1>
<h2>request</h2>
<p>The URL request to load. The request object is deep-copied as part of the initialization process. Changes made to request after this method returns do not affect the request that is used for the loading process.</p>
<h2>queue</h2>
<p>The operation queue to which the handler block is dispatched when the request completes or failed.</p>
<h2>handler</h2>
<p>The handler block to execute.</p>
<h1>Discussion</h1>
<p>If the request completes successfully, the data parameter of the handler block contains the resource data, and the error parameter is nil. If the request fails, the data parameter is nil and the error parameter contain information about the failure.</p>
<p>If authentication is required in order to download the request, the required credentials must be specified as part of the URL. If authentication fails, or credentials are missing, the connection will attempt to continue without credentials. If the request finishes with a 401 Unauthorized status code, the response parameter is nil, the data parameter contains the resource data, and the error parameter is an NSError with the NSURLErrorUserCancelledAuthentication code in the NSURLErrorDomain error domain.</p>
<h1>Availability</h1>
<p>Available in iOS 5.0 and later.</p>
<p>Deprecated in iOS 9.0.</p>
</blockquote>
<p>如果还有什么不清楚的地方请告诉我。</p>
<p><strong>编辑 1</strong>:</p>
<p>关于</p>
<pre><code>;
;
;
;
;
;
;
</code></pre>
<p>那些为 <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html" rel="noreferrer noopener nofollow">HTTP header fields</a> 设置了不同的值最后是请求中的 HTTP 正文。</p></p>
<p style="font-size: 20px;">关于ios - 这个 Web 服务调用代码是什么,到底发生了什么?,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/34740028/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/34740028/
</a>
</p>
页:
[1]