Replies: 5 comments 5 replies
-
|
Beta Was this translation helpful? Give feedback.
-
If next url is available then Now as per the code in the next iteration of the loop it has to call the url of 'example.test?page=2' But it calls the url and so the next url is still present and it will be the same url and thus ends in an infinite loop. |
Beta Was this translation helpful? Give feedback.
-
You can create a second endpoint on the sample public repo that mimics the external endpoint. |
Beta Was this translation helpful? Give feedback.
-
Here, I made it for you: https://github.com/rodrigopedra/bug-report Instructions are on The issue is that you are using both a query parameter in the URL ( When the options are populated, Laravel does not parse the URL for parameters. framework/src/Illuminate/Http/Client/PendingRequest.php Lines 1144 to 1169 in 57d6188 It seems to me that Laravel should handle both cases (query parameters in the URL and in the request options). I can't work on a PR right now, as I am leaving for lunch and will be out for the whole day off. If you can, be my guest. As a workaround, you can parse the next URL query parameters, and add them to the request's options. |
Beta Was this translation helpful? Give feedback.
-
Hey @crynobone any insights why this was moved to a discussion? When consuming paginated results where the external API sends a URL with a query parameter, the HTTP Client ignores the URL's query parameter if the developer is also setting query parameters on the request Shouldn't this be considered an issue? Thanks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Laravel Version
11.9
PHP Version
8.3
Database Driver & Version
No response
Description
I am trying to use HTTP client in a do while loop for pagination. Somehow after calling the first url even after using the updating the url is it calling the same url in the first instance of the loop.
Steps To Reproduce
This is where i setting up some basic things.
Here i call the paginated urls.
even though we get he current url and the new url is passed. The first loop url is getting used.
But,
If I directly use like Http::get then i am not getting this issue. This is really confusing.
Beta Was this translation helpful? Give feedback.
All reactions