Update webpagetool.php
This commit is contained in:
parent
7e836f5615
commit
042e6f4226
|
@ -123,14 +123,22 @@ if(!check_function_exists("get_web_cmd")) {
|
||||||
$args[] = $url;
|
$args[] = $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($method == "jsondata") {
|
if($method == "jsondata" || $method == "rawdata") {
|
||||||
$_data = json_encode($data);
|
|
||||||
$args[] = "-X POST"; // set post request (the same as -X)
|
$args[] = "-X POST"; // set post request (the same as -X)
|
||||||
$args[] = sprintf("-A '%s'", get_web_user_agent($ua)); // set agent
|
$args[] = sprintf("-A '%s'", get_web_user_agent($ua)); // set agent
|
||||||
$args[] = "-k"; // allow self-signed certificate (the same as --insecure)
|
$args[] = "-k"; // allow self-signed certificate (the same as --insecure)
|
||||||
$headers['Content-Type'] = "application/json;charset=utf-8";
|
|
||||||
$headers['Accept'] = "application/json, text/plain, */*";
|
if($method == "jsondata") {
|
||||||
|
$_data = json_encode($data);
|
||||||
|
$headers['Content-Type'] = "application/json;charset=utf-8";
|
||||||
|
$headers['Accept'] = "application/json, text/plain, */*";
|
||||||
|
} else {
|
||||||
|
$headers['Content-Type'] = "text/plain"; // possible: application/octet-stream (RFC2046)
|
||||||
|
}
|
||||||
|
|
||||||
|
// get content size
|
||||||
$headers['Content-Length'] = strlen($_data);
|
$headers['Content-Length'] = strlen($_data);
|
||||||
|
|
||||||
foreach($headers as $k=>$v) {
|
foreach($headers as $k=>$v) {
|
||||||
// the same as --header
|
// the same as --header
|
||||||
if(is_array($v)) {
|
if(is_array($v)) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user