V
V
Vladislav2020-05-28 16:43:57
PHP
Vladislav, 2020-05-28 16:43:57

How to send curl request as query in php?

Tell me how to send a curl request to php, not as usual.
And as a line like this:

curl -H 'Host: site.ru' -H 'Cookie: mda=0; yandex_gid=172; yandexuid=3517007391590667526; ymex=1906027527.yrts.1590667527; _ym_uid=1590667527937076072; _ym_isad=2; i=iftqtARQu8sDdIKNbDwHoR8dnKREhvpq7FByWVLqZJYhi4+nVRlbhq71S0MY0NPFt3b5AFOMzysggD7w1NT7PcwrSSE=; yabs-frequency=/4/0000000000000000/9cwmS60xW000/; gdpr=0; _ym_d=1590669776; ys=svt.1#def_bro.0#wprid.1590671735064461-1739453227112912767600300-production-app-host-vla-web-yp-44#ybzcc.ru; _ym_visorc_50377519=b; yp=1593259527.ygu.1#1622203527.cld.2270452#1622203527.brd.6400000000#1590679781.gpauto.54_735146:55_958729:100000:3:1590672581#1622205261.p_sw.1590669261#1591273319.szm.1:1280x1024:1232x908#1591273320.zmblt.1609#1591273320.zmbbr.yandexbrowser:20_4_3_257#1590755683.ln_tp.01' -H 'accept: application/json' -H 'content-type: application/x-www-form-urlencoded' -H 'sec-fetch-site: none' -H 'sec-fetch-mode: no-cors' -H 'sec-fetch-dest: empty' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 YaBrowser/20.4.3.257 Yowser/2.5 Yptp/1.23 Safari/537.36' -H 'accept-language: ru,en;q=0.9' --data-binary "text=%D0%B1%D0%B0%D1%80%D0%B0+%D0%B1%D0%B0%D1%80%D0%B0+%D0%B1%D0%B5%D1%80%D0%B5%2C+%D0%B1%D0%B5%D1%80%D0%B5+%D0%B1%D0%B0%D1%80%D0%B0+%D0%B1%D0%B0%D1%80%D0%B0+%D1%8F+%D0%B4%D1%83%D1%80%D0%B0%D0%B0+%D1%85%D0%B0%D1%85%D0%B0%D1%85%D0%B0%D0%B0%D1%85&brandID=yandex&statLang=en&targetLang=auto&url=http%3A%2F%2Ftts%2F&title=Document&before=&after=&locale=ru&clid=2270464&disable=serp" --compressed 'https://site.ru'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2020-05-28
@cr1gger

such a line is quietly rewritten to "as is usually done".
if lazy, then you can pull through the syscol if curl is installed in the system:
https://www.php.net/manual/ru/function.exec
https://www.php.net/manual/ru/function.system. php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question