让 cocos2d-x 的 CCHttpRequest 支持https(4)
来源:未知 责任编辑:责任编辑 发表时间:2013-11-26 22:12 点击:次
p> break;
p> }
p> code = curl_easy_setopt(curl, CURLOPT_POSTFIELDS, request->getRequestData());
p> if (code != CURLE_OK) {
p> break;
p> }
p> code = curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, request->getRequestDataSize());
p> if (code != CURLE_OK) {
p> break;
p> }
p> code = curl_easy_perform(curl);
p> if (code != CURLE_OK) {
p> break;
p> }
p>
p> /* free the linked list for header data */
p> curl_slist_free_all(cHeaders);
p>
p> code = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, responseCode);
p> if (code != CURLE_OK || *responseCode != 200) {
p> code = CURLE_HTTP_RETURNED_ERROR;
p> }
p> } while (0);
p> if (curl) {
p> curl_easy_cleanup(curl);
p> }
p>
p> return (code == CURLE_OK ? 0 : 1);
p>}
p>
p>
p>
p>
p>[cpp]
p>code = curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
p> if (code != CURLE_OK) {
p> break;
p> }
p>[cpp]
p>加入这一段curl代码, 即可支持解析https解析,不管是get还是post都可
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>