%26nbsp;GET %26amp; POST 的对比
%26nbsp;
源码:https://github.com/SpongeBob-GitHub/Get-Post.git
%26nbsp;
%26nbsp;1. URL
%26nbsp; %26nbsp; - GET
%26nbsp; %26nbsp; %26nbsp; %26nbsp; 所有的参数都包含在 URL 中
%26nbsp;
%26nbsp; %26nbsp; %26nbsp; %26nbsp; 1. 如果需要添加参数,脚本后面使用 `?`
%26nbsp; %26nbsp; %26nbsp; %26nbsp; 2. 参数格式:值对
%26nbsp; %26nbsp; %26nbsp; %26nbsp; %26nbsp; %26nbsp; 参数名=值
%26nbsp; %26nbsp; %26nbsp; %26nbsp; 3. 如果有多个参数,使用 `%26amp;` 连接
%26nbsp; %26nbsp; %26nbsp; %26nbsp; 4. 在 get 方法中,url字符串中不能包含中文或者特殊符号 空格
%26nbsp;%26nbsp; %26nbsp; %26nbsp; %26nbsp; %26nbsp; 如果出现,需要添加百分号转义
%26nbsp;
%26nbsp; %26nbsp; - POST
%26nbsp; %26nbsp; %26nbsp; %26nbsp; URL中不包含参数,直接指定登录脚本即可
%26nbsp;
%26nbsp;2. Request
%26nbsp;
%26nbsp; %26nbsp; - GET
%26nbsp; %26nbsp; %26nbsp; %26nbsp; - 因为 GET 的效率高,而且性能好,能够被缓存,使用频率高
%26nbsp; %26nbsp; %26nbsp; %26nbsp; - 是默认的请求方法,不需要任何设定
%26nbsp;
%26nbsp; %26nbsp; - POST
%26nbsp; %26nbsp; %26nbsp; %26nbsp; - 需要指定请求方法
%26nbsp; %26nbsp; %26nbsp; %26nbsp; %26nbsp; %26nbsp; request.HTTPMethod = @"POST";
%26nbsp; %26nbsp; %26nbsp; %26nbsp; - 所有参数都包含在请求体中,二进制数据,来源:firebug的源代码中粘贴
%26nbsp; %26nbsp; %26nbsp; %26nbsp; - 参数格式,和 GET 的几乎一致,只是没有 `?`
%26nbsp; %26nbsp; %26nbsp; %26nbsp; - POST方法获得的网络数据不能被缓存
%26nbsp;
%26nbsp;3. Connection
%26nbsp; %26nbsp; 这是一个最单纯的网络方法,只是发送"