Questions tagged [laravel-http-client]
13 questions
1
vote
2 answers
Laravel Http client before request send add headers
I'm using Http client for making outgoing HTTP requests. I've used it many places in the project.Now project has new requirement that I have to add a new header to every outgoing
requests. I can do this by adding it to every places. But I want to…

Utm sandeep
- 53
- 7
0
votes
1 answer
Laravel Http Client User-Agent header as -A
How can I pass User-Agent header with a especial curl parameter -A, not -H?
This code adds User-Agent with -H parameter, not -A:
Http::withHeaders(['User-Agent' => 'Mozilla/5.0 (Android 13; Mobile; rv:109.0) Gecko/111.0 Firefox/111.0'])
This code…

osipovmn
- 1
- 1
0
votes
1 answer
Upload Worker Module In Cloudflare
I have an issue with uploading the worker.js file using Laravel Http class,
this is docs link: Upload Worker Module
My code
$response = Http::baseUrl(self::BASE_URL)
->withHeaders(['Content-Type' => 'multipart/form-data'])
…

Taha Mohamed
- 77
- 4
0
votes
0 answers
Why image uploaded Telegram message is broken in 41 b size?
In laravel app (9.19) with guzzlehttp(7.2 ) and "laravel-notification-channels/telegram (3.0 ) I send image attached to post request like :
$response = Http::attach('document', $fileUrlToUpload, 'document.png')
…

mstdmstd
- 2,195
- 17
- 63
- 140
0
votes
2 answers
How to post request with query params in laravel 9
I am trying to send post request with query params, just like this screenshot
I used Http::post but it supports only JSON as far as I know. I just want to send request just like the screenshot. cause API data only supports parameter wise. Here What…

Sakib ovi
- 537
- 3
- 19
0
votes
1 answer
Laravel problem when caching HTTP Client response
I use the file as cache driver and I want to cache the response from HTTP Client, but when I first time call a function everything works but when I call the function a second time to get data from cache I get this error
fseek(): Argument #1…

David Milenkovic
- 3
- 2
0
votes
0 answers
Mailgun API - Send URL as attachment in Send Email not working
I am trying to send url as attachment using Send Email api in Mailgun. But the attachment is not attached. I am using Laravel HTTP client
$params = [
'from' => $selected_options['mg_from_email'],
'to' =>…

kenpachi_zaraki
- 31
- 2
0
votes
1 answer
Laravel - cURL exceception - try catch not working
It seems that the issue I am facing is straightforward but somehow the resolutions suggested here, here, and here are not working
I have got the following piece of code:
namespace App\Traits;
use Illuminate\Support\Facades\Http;
use…

burf
- 153
- 2
- 8
0
votes
1 answer
404 not found after changing header content-type from application/json to multipart/form-data laravel
public function customHeaders()
{
return [
'Authorization' => request()->header('Authorization'),
'Content-Type' => 'multipart/form-data',
'Access-Control-Allow-Credentials' => true,
];
}
public function post(Request…

toffeegz
- 88
- 6
0
votes
1 answer
Laravel HTTP facade does not return content-length in response headers
I have a controller which calls multiple GET requests from Gmail API,
Basically, I am trying to get most recent 50 SENT MESSAGES.
What I did was pool these requests, and loop the Pool response and insert the retrieved data to my db.
$resp =…

devme deveper
- 79
- 1
- 7
0
votes
1 answer
how to remove index.php from the url in laravel
suppose my site open with the url https://www.example.com and it also opens with the https://www.example.com/index.php but i want it to open only with the https://www.example.com ONLY and not with https://www.example.com/index.php
just want to know…
user17984731
-1
votes
2 answers
Can I get lastInsertId value after Http Client Post request?
On laravel site making Http Post request I need to get id of the l;ast inserted ID, like:
$response = Http::withToken($this->token)->post(route('articles.store'), [
'title' => 'Item Title lorem',
'text' => 'Item Text lorem',
…

Petro Gromovo
- 1,755
- 5
- 33
- 91
-1
votes
2 answers
Multiple API calls in one controller/action laravel
I am working on a laravel project where I need to show a list and stats from API. For stats and a list of content, there are separate URLs. And I have to display both on one page.
How to call multiple API URLs on a page?
Suppose…

esel
- 77
- 1
- 11