Update webpagetool.php

This commit is contained in:
Namhyeon Go 2020-02-07 17:15:22 +09:00 committed by GitHub
parent b6f75980d2
commit cc79e17b93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -133,8 +133,10 @@ if(!check_function_exists("get_web_cmd")) {
$headers['Content-Type'] = "application/json;charset=utf-8";
$headers['Accept'] = "application/json, text/plain, */*";
} else {
// possible: application/octet-stream (RFC2046)
$_data = $data;
$headers['Content-Type'] = "text/plain"; // possible: application/octet-stream (RFC2046)
$headers['Content-Type'] = "text/plain;charset=utf-8";
$headers['Accept'] = "text/plain, */*";
}
// get content size
@ -345,6 +347,16 @@ if(!check_function_exists("get_web_curl")) {
$headers['Accept'] = "application/json, text/plain, */*";
$headers['Content-Length'] = strlen($_data);
}
if($method == "rawdata") {
$_data = $data;
$options[CURLOPT_CUSTOMREQUEST] = "POST";
$options[CURLOPT_POST] = 1;
$options[CURLOPT_POSTFIELDS] = $_data;
$headers['Content-Type'] = "text/plain;charset=utf-8";
$headers['Accept'] = "text/plain, */*";
$headers['Content-Length'] = strlen($_data);
}
}
if(count($headers) > 0) {