MSRC-Microsoft-Engage-API/phpEx.php

37 строки
748 B
PHP

<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';
$request = new Http_Request2('https://api.msrc.microsoft.com/report/v2.0/abuse');
$url = $request->getUrl();
$headers = array(
// Request headers
'Content-Type' => 'application/json'
);
$request->setHeader($headers);
$parameters = array(
// Request parameters
);
$url->setQueryVariables($parameters);
$request->setMethod(HTTP_Request2::METHOD_POST);
// Data model documentation at https://msrc.microsoft.com/report/developer
$request->setBody("{body}");
try
{
$response = $request->send();
echo $response->getBody();
}
catch (HttpException $ex)
{
echo $ex;
}
?>