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