| @@ 190-206 (lines=17) @@ | ||
| 187 | * @see https://developers.google.com/safe-browsing/developers_guide_v2#HTTPRequestForHashes |
|
| 188 | * @return array |
|
| 189 | */ |
|
| 190 | public function checkHash($bodyString = '') |
|
| 191 | { |
|
| 192 | $resource = 'gethash'; |
|
| 193 | ||
| 194 | $response = $this->sendRequest( |
|
| 195 | 'POST', |
|
| 196 | $this->getServiceUrl($resource), |
|
| 197 | [ |
|
| 198 | 'body' => $bodyString |
|
| 199 | ] |
|
| 200 | ); |
|
| 201 | ||
| 202 | return [ |
|
| 203 | 'code' => $response->getStatusCode(), |
|
| 204 | 'data' => $response->getBody() |
|
| 205 | ]; |
|
| 206 | } |
|
| 207 | ||
| 208 | /** |
|
| 209 | * @param string $bodyString |
|
| @@ 213-229 (lines=17) @@ | ||
| 210 | * @see https://developers.google.com/safe-browsing/developers_guide_v2#HTTPRequestForData |
|
| 211 | * @return array |
|
| 212 | */ |
|
| 213 | public function getChunks($bodyString = '') |
|
| 214 | { |
|
| 215 | $resource = 'downloads'; |
|
| 216 | ||
| 217 | $response = $this->sendRequest( |
|
| 218 | 'POST', |
|
| 219 | $this->getServiceUrl($resource), |
|
| 220 | [ |
|
| 221 | 'body' => $bodyString |
|
| 222 | ] |
|
| 223 | ); |
|
| 224 | ||
| 225 | return [ |
|
| 226 | 'code' => $response->getStatusCode(), |
|
| 227 | 'data' => $response->getBody() |
|
| 228 | ]; |
|
| 229 | } |
|
| 230 | ||
| 231 | /** |
|
| 232 | * @see https://developers.google.com/safe-browsing/developers_guide_v2#HTTPRequestForList |
|