Я пытаюсь сделать POST-запрос к другому веб-сайту, используя curl в приложении laravel, но я получаю следующий ответ:
Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
Я попытался включить __EVENTVALIDATION
входные данные в свой запрос на публикацию через запрос скручивания и поместить его в представление макета, а затем в запрос на публикацию
// this code is for getting the value of EVENTVALIDATION and pass it to my layout blade
$xp = new \DOMXpath($document);
$nodes = $xp->query('//input[@name="__EVENTVALIDATION"]');
$node = $nodes->item(0);
$node = $nodes->item(0);
$eventvalidation = $node->getAttribute('value');
Session::put('eventvalidation ', $eventvalidation );
// this code if for the post request
$postdata = array();
$edited = false;
$do_coupon = false;
$url = 'https://ww3.365planetwinall.net/Sport';
foreach ($request->all() as $key => $value)
{
$postdata[$key] = $value;
}
if ($request->input('h$w$PC$cCoupon$txtCouponCodiceAnonimo'))
{
Session::set('codice', $request->input('h$w$PC$cCoupon$txtCouponCodiceAnonimo'));
}
if ($request->input('h$w$SM') && $request->input('h$w$SM') == 'h$w$PC$cCoupon$atlasCoupon|h$w$PC$cCoupon$lnkAvanti')
{
$postdata['h$w$SM'] = 'h$w$PC$cCoupon$atlasCoupon|h$w$PC$cCoupon$lnkAvantiAnonimo';
$postdata['__EVENTTARGET'] = 'h$w$PC$cCoupon$lnkAvantiAnonimo';
$postdata['__EVENTVALIDATION'] = Session::get('eventvalidation');
Ожидание ответа на почтовый запрос
но я получаю это:
Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.