| @@ 52-67 (lines=16) @@ | ||
| 49 | unset($params[$fieldName]); |
|
| 50 | } |
|
| 51 | ||
| 52 | foreach ($params as $key => $value) { |
|
| 53 | if (is_array($value)) { |
|
| 54 | $index = 0; |
|
| 55 | foreach ($value as $subValue) { |
|
| 56 | $postDataMultipart[] = [ |
|
| 57 | 'name' => sprintf('%s[%d]', $key, $index++), |
|
| 58 | 'content' => $subValue, |
|
| 59 | ]; |
|
| 60 | } |
|
| 61 | } else { |
|
| 62 | $postDataMultipart[] = [ |
|
| 63 | 'name' => $key, |
|
| 64 | 'content' => $value, |
|
| 65 | ]; |
|
| 66 | } |
|
| 67 | } |
|
| 68 | ||
| 69 | $response = $this->httpPostRaw(sprintf('/v3/%s/messages', $domain), $postDataMultipart); |
|
| 70 | ||
| @@ 163-178 (lines=16) @@ | ||
| 160 | } |
|
| 161 | ||
| 162 | $postDataMultipart = []; |
|
| 163 | foreach ($postData as $key => $value) { |
|
| 164 | if (is_array($value)) { |
|
| 165 | $index = 0; |
|
| 166 | foreach ($value as $subValue) { |
|
| 167 | $postDataMultipart[] = [ |
|
| 168 | 'name' => sprintf('%s[%d]', $key, $index++), |
|
| 169 | 'contents' => $subValue, |
|
| 170 | ]; |
|
| 171 | } |
|
| 172 | } else { |
|
| 173 | $postDataMultipart[] = [ |
|
| 174 | 'name' => $key, |
|
| 175 | 'contents' => $value, |
|
| 176 | ]; |
|
| 177 | } |
|
| 178 | } |
|
| 179 | ||
| 180 | return $this->send('POST', $endpointUrl, [], array_merge($postDataMultipart, $postFiles)); |
|
| 181 | } |
|