6 public function show($httpReq, $uploadsInfo = [], $dedicatedBody = false)
9 if ($httpReq->getMethod() != 'GET') {
10 $command .= ' -X ' . $httpReq->getMethod();
12 foreach ($httpReq->getHeaders() as $key => $val) {
13 $caseKey = implode('-', array_map('ucfirst', explode('-', $key)));
14 $command .= ' -H ' . escapeshellarg($caseKey . ': ' . $val);
17 $postParams = $httpReq->getPostParams();
19 if (count($uploadsInfo) == 0) {
20 foreach ($postParams as $k => $v) {
22 $command .= ' -d ' . escapeshellarg($k . '=' . $v);
24 foreach ($v as $ak => $av) {
25 $command .= ' -d ' . escapeshellarg(
26 $k . '[' . $ak . ']=' . $av
32 foreach ($postParams as $k => $v) {
33 $command .= ' -F ' . escapeshellarg($k . '=' . $v);
35 foreach ($uploadsInfo as $fieldName => $fileName) {
36 if (!is_array($fileName)) {
37 $command .= ' -F ' . escapeshellarg(
38 $fieldName . '=@' . $fileName
41 foreach ($fileName as $k => $realFilename) {
42 $command .= ' -F ' . escapeshellarg(
43 $fieldName . '[' . $k . ']=@' . $realFilename
51 $command .= ' --data ' . escapeshellarg($httpReq->getBody());
54 $command .= ' ' . escapeshellarg((string) $httpReq->getUrl());