Update webpagetool.php
This commit is contained in:
parent
32210df8a5
commit
5e4da8f2ca
|
@ -2,7 +2,7 @@
|
||||||
/**
|
/**
|
||||||
* @file webpagetool.php
|
* @file webpagetool.php
|
||||||
* @created_on 2018-06-01
|
* @created_on 2018-06-01
|
||||||
* @updated_on 2020-02-26
|
* @updated_on 2020-04-06
|
||||||
* @author Go Namhyeon <gnh1201@gmail.com>
|
* @author Go Namhyeon <gnh1201@gmail.com>
|
||||||
* @brief WebPageTool helper
|
* @brief WebPageTool helper
|
||||||
*/
|
*/
|
||||||
|
@ -137,7 +137,7 @@ if(!is_fn("get_web_cmd")) {
|
||||||
|
|
||||||
// #110 [helper/webpagetool] post array data, but (string)`Array` given
|
// #110 [helper/webpagetool] post array data, but (string)`Array` given
|
||||||
if(count($_data)) > 0) {
|
if(count($_data)) > 0) {
|
||||||
$args[] = sprintf("--data '%s'", make_safe_argument(http_build_query($_data)));
|
$args[] = sprintf("--data '%s'", get_web_build_qs("", $_data));
|
||||||
}
|
}
|
||||||
|
|
||||||
$args[] = $url;
|
$args[] = $url;
|
||||||
|
@ -390,7 +390,7 @@ if(!is_fn("get_web_httpie")) {
|
||||||
} elseif($method == "post") {
|
} elseif($method == "post") {
|
||||||
$args[] = "POST";
|
$args[] = "POST";
|
||||||
$args[] = $url;
|
$args[] = $url;
|
||||||
$args[] = sprintf("body='%s'", http_build_query($data));
|
$args[] = sprintf("body='%s'", get_web_build_qs("", $data));
|
||||||
} else {
|
} else {
|
||||||
$args[] = get_web_build_qs($url, $data);
|
$args[] = get_web_build_qs($url, $data);
|
||||||
}
|
}
|
||||||
|
@ -480,7 +480,7 @@ if(!is_fn("get_web_curl")) {
|
||||||
|
|
||||||
$options[CURLOPT_POST] = 1;
|
$options[CURLOPT_POST] = 1;
|
||||||
if(is_array($data)) {
|
if(is_array($data)) {
|
||||||
$options[CURLOPT_POSTFIELDS] = http_build_query($data);
|
$options[CURLOPT_POSTFIELDS] = get_web_build_qs("", $data);
|
||||||
} else {
|
} else {
|
||||||
$options[CURLOPT_POSTFIELDS] = $data;
|
$options[CURLOPT_POSTFIELDS] = $data;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user