note 124899 added to book.curl
| From: | yaroslav at oleksiienko dot pp dot ua | Date: | Sat, 11 Apr 2020 09:06:50 +0000 |
| Subject: | note 124899 added to book.curl | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-214440@lists.php.net to get a copy of this message | ||
OMG! Someone handle the issue with CURL double requests?
The code form an example of curl_exec that executes simple get request, send it twice to my simple
script
<?php
echo json_encode(["error" => 0]);
file_put_contents(__DIR__ .
'/log.txt',print_r(getallheaders(),true)."\n\n",FILE_APPEND);
?>
The file "log.txt" shows multiple requests!
```
Array
(
[Host] => domain.com
[X-Forwarded-For] => xxx.xxx.xxx.xxx
[Connection] => close
[Accept] => */*
)
Array
(
[Host] => domain.com
[X-Forwarded-For] => xxx.xxx.xxx.xxx
[Connection] => close
[Accept] => */*
)
```
How to send only one request????? I broke my head off!!! No answers are on internet!
----
Server IP: 45.112.84.4
Probable Submitter: 185.85.3.195 (proxied: 91.242.152.217)
----
Manual Page -- http://php.net/manual/en/book.curl.php
Edit -- https://master.php.net/note/edit/124899
Del: integrated -- https://master.php.net/note/delete/124899/integrated
Del: useless -- https://master.php.net/note/delete/124899/useless
Del: bad code -- https://master.php.net/note/delete/124899/bad+code
Del: spam -- https://master.php.net/note/delete/124899/spam
Del: non-english -- https://master.php.net/note/delete/124899/non-english
Del: in docs -- https://master.php.net/note/delete/124899/in+docs
Del: other reasons-- https://master.php.net/note/delete/124899
Reject -- https://master.php.net/note/reject/124899
Search -- https://master.php.net/manage/user-notes.php