30 questions
0
votes
0
answers
66
views
Curl is returning response but Laravel Http client is not returnig respose
-> The below code is based on php Curl.
$curl = curl_init();
// API Endpoint
$url = 'https://api.bybit.com/fht/compliance/tax/v3/private/registertime';
curl_setopt_array($curl, array(
CURLOPT_URL =...
2
votes
0
answers
163
views
how use Http client (post request)
In pure php, I made a query of the following type:
$post_data = http_build_query([
'integrationModule' => json_encode($body)
]);
$header = [
'Content-Type: application/x-www-form-...
1
vote
0
answers
60
views
How I can associate my request with my response at the responseMiddleware?
I try to provide a custom Logging Mechanism for Laravel's http client:
$httpClient = Http::withBasicAuth($this->apiKey, $this->apiSecret)
->retry(3,100,null,false)
-&...
0
votes
1
answer
83
views
I need to send an http request from Laravel 10 to cPanel UAPI to create a new email
According to the cPanel documentation:
To call a UAPI function with an API token, run the following command from the command line:
curl -H'Authorization: cpanel username:APITOKEN' 'https://example....
0
votes
0
answers
286
views
Laravel Http Client return null
I need help in Laravel calling external API. I have two websites: Website A and Website B. Before installing SSL in Website A (http://website A): In Website A controller, I use $response=Http::get('...
0
votes
0
answers
199
views
Facebook Meta Resumable Upload API Permission Error Unsupported post request. Object with ID 'upload:MT....'
I am trying to upload media using Resumable Upload API
But i am getting error in 2nd step:
[
"error" => [
"message" => "Unsupported post request. Object with ...
1
vote
2
answers
3k
views
How to send cookie with Laravel Http client?
I am trying to set cookies using the Laravel HTTP client. I know Laravel uses guzzlehttp/guzzle library in the backend.
This is the error I am getting when I try to set the cookies using withOptions ...
0
votes
1
answer
304
views
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;...
0
votes
1
answer
434
views
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(['...
0
votes
0
answers
77
views
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, '...
-1
votes
2
answers
68
views
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' => '...
1
vote
3
answers
6k
views
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 ...
0
votes
2
answers
1k
views
How to calculate percentage while getting data from API response
I'm getting response from an API in Laravel using HTTP client. And It takes some time. I just want to calculate that how much percentage of data is fetched from API. And when progressbar of 100% ...
1
vote
1
answer
2k
views
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 ...
0
votes
1
answer
576
views
Laravel API - http client - database error
I have an API endpoint on domain-1
Route::get('users', [UserApiController::class, 'index'])
and I try to retrieve the data from domain-2.
I use the HTTP client to execute a request on the API route.
...
0
votes
1
answer
804
views
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 ...
3
votes
1
answer
1k
views
HttpClient throws an error "An error was encountered while creating the response"
I am integrating an API in which I have to send my request in encrypted mode and for that I am using httpClient but when I tried this I am getting:
GuzzleHttp\Exception\RequestException
An error was ...
0
votes
1
answer
892
views
how to access array in Post request with http client laravel [closed]
i have this function to store data from a blade form:
$store = Http::withHeaders([
'Content-Type' => 'application/json',
'Authorization' => $token,
])->post('http://...
0
votes
1
answer
704
views
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-...
0
votes
0
answers
252
views
Laravel HttpClient Guzzle. Images and Array not sending at same time. 'A 'contents' key is required
//These Images
for($i = 0 ; $i < count($request['images']); $i++)
{
$response = $response->attach('images['.$i.']', file_get_contents($request['images'][$i]), 'image.png' );
}...
0
votes
1
answer
2k
views
Shopee API access token?
I'm new to Shopee API and just want to know how can I find the access token?
$host = '*****';
$date = new DateTime();
$timestamp = $date->getTimestamp();
$partner_id = ****;
$shop_id = ****;
$...
3
votes
2
answers
4k
views
How to send Image or file to the external API using HTTP Client?
I have an API to save images and files
this is the code to save the image request from the API
$file = $request->file('gambar');
$fileName = $file->getClientOriginalName();
$file->storeAs('...
0
votes
1
answer
1k
views
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 ...
0
votes
1
answer
2k
views
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 ...
1
vote
2
answers
3k
views
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 ...
0
votes
2
answers
2k
views
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 ...
3
votes
2
answers
4k
views
how to upload image using http client laravel to API
I want to update/upload an image using http client laravel. I did update the data but the image are not updated. the API are blob type. I try to use form-data file in postman and it did work. but I ...
4
votes
0
answers
513
views
A Contents Key Is required - Sending Arrays
I am having issues sending data over Laravel HTPP. I have an array of data and x number of files to be attached. i have managed to attach the file they are sending and being delivered to the endpoint ...
0
votes
0
answers
304
views
Laravel HTTP Client not passing the data to API
Controller request where I'm passing from parameters to API:
$response = Http::withOptions([
'debug' => true,
])->post('https://starznets.com/api/login.php', [
'dosubmit' ...
-1
votes
1
answer
1k
views
Laravel API Rest doesn't work in device Android
I have an app in IONIC and in browser the call to API works but when I run on Android device it shows this error:
HttpErrorResponse {headers: HttpHeaders, status: 0, statusText: "Unknown Error&...