Category : curl

I want to setup a small file of cURL requests so I can quickly test my Laravel app’s API quickly. Unfortunately, I’m stuck at logging in :D. This is what I have so far: curl -H "Accept: application/json" -d @./curl/user.json http://localhost:8000/login -o ./curl/response.json -v I have a user.json file that has my login info: { ..

Read more

I have a Laravel project in which I’m using the GoCardless API with the PHP Client wrapper from https://github.com/gocardless/gocardless-pro-php. I have set it up very simply like so. <?php namespace AppHttpControllers; use IlluminateHttpRequest; use GoCardlessProClient; class PaymentController extends Controller { /** * Display the index page where we begin a payment flow. */ public function ..

Read more

While I am trying to post on Tumblr blog from my Laravel App, I Get This error https://exampleblog.tumblr.com/ : cURL error 56: Received HTTP code 407 from proxy after CONNECT (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) – /home/seopri721/seoprime/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:201 response null I don’t know even what to share here. Just ask me what you need to help me I got ..

Read more

I am consuming an API from pure PHP and I have to migrate to Laravel and use Guzzle, I am having trouble doing it PHP: $params=[ ‘tipoSuministro’=>’E’, ‘codigoPostal’=>’1234’, ‘potencia’=>’1’ ]; $ch = curl_init(); switch($_REQUEST[‘tipoSuministro’]) { case "E": $url = "https://xxxxxxx/api/ofertas/electricidad?"; break; } curl_setopt($ch, CURLOPT_URL, $url.http_build_query($params)); $result->detalle_oferta = json_decode($detalle); My Guzzle $client = new GuzzleHttpClient([ ‘base_uri’ ..

Read more

I’m using cloudinary-labs/cloudinary-laravel package to upload images to Cloudinary using the following code: $result = Cloudinary::upload($request->file(‘photo’)->getRealPath()); but I get cURL error 60 with the following details: "message": "cURL error 60: SSL certificate problem: self signed certificate in certificate chain (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.cloudinary.com/v1_1/{MY-CLOUD-NAME}/image/upload", "exception": "GuzzleHttpExceptionRequestException", "file": "F:open-source-projectssooravendorguzzlehttpguzzlesrcHandlerCurlFactory.php", "line": 211, At first, I thought I knew ..

Read more

I was able to send push notifications to both Ios/Android using php and curl.Right now i want to update the code to send additional parameters such as user_id,name.So i can get these information on my frontend side.But i don’t know how to pass these data.Can anyone please help me. function sendPushNotification($token,$push_notification_title=null,$push_notification_body=null){ $url = env(‘FIREBASE_URL’); $serverKey ..

Read more

i make a simple api which return some value but if i add this line and pass data like curl_setopt($cURLConnection, CURLOPT_POSTFIELDS , $data); my api return null here is the complete code $data = [‘a’ => "data"]; $url = env(‘MOTHERSHIP_URL’) . ‘/store/cstore/receipt’; Log::debug("url=" . $url); $cURLConnection = curl_init(); curl_setopt($cURLConnection, CURLOPT_URL, $url); curl_setopt($cURLConnection, CURLOPT_POST, true); curl_setopt($cURLConnection, ..

Read more

I am getting this error, I have created certificate file and private key file, this error in php laravel route, I want solution of this. please help me to resolve this issue. Route::get(‘/twoway_auth’, function(){ $url = ‘https://preprodb2b.alinma.com’; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_PORT , 4443); curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_CAINFO, ..

Read more

I have an array of params which I’m sending in CURL get request but not getting params which I have checked. I want to send these params(key, value) in curl get request but not sending giving empty data this is my code you can see that $params = []; foreach($product_data->params as $param) { array_push($params, $param); ..

Read more

I’m trying to get the rcmDriverAgesInfo data from this curl ‘https://apis.rentalcarmanager.com/booking/v3.1/API_KEY/step2/0/5/17_11_2021/11_00/5/23_11_2021/11_00/2/0/-/-?apikey=API_KEY’ -H ‘User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0’ -H ‘Accept: image/webp,*/*’ -H ‘Accept-Language: en-US,en;q=0.5’ –compressed -H ‘Connection: keep-alive’ -H ‘Cookie: PHPSESSID=dksko0e9vkcuggi7lk7o94eaq1’ -H ‘Pragma: no-cache’ -H ‘Cache-Control: no-cache’ -H ‘TE: Trailers’ And This is my code <? $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => ..

Read more

i want to integrate stripe in my laravel project, it gives me error: cURL error 77: error setting certificate verify locations: CAfile: D:wamp64binphpphpphp7.3.5extrassslcurl-ca-bundle.crt CApath: none (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.stripe.com/v1/charges?amount=0&currency=CAD&description= Order`, I found some solution such as: here and I notice that most of the question ask for … sslcacert.pem CApath: none .. but me it ..

Read more

When the error case comes to default, am getting the message only as undocumented error: 504 : . It is not showing what curlError it is. Any solutions? curl_setopt($curl,CURLOPT_RETURNTRANSFER,true); $res=curl_exec($curl); $httpCode=curl_getinfo($curl, CURLINFO_HTTP_CODE); switch ($httpCode){ case 200: $error="200: success"; break; case 404: $error="404: Api not found"; break; default: $error="undocumented error:".$httpCode.":".curl_error($curl); break; } Sourc..

Read more

I’m using cURL on my website to extract data such as product image, name, and price. I’ve used cURL for Tokopedia and it works. But it doesn’t seem to work for Shopee. Here’s the cURL code <?php $url2 = ‘https://shopee.co.id/search?keyword=aoc%2024g2’; $ch2 = curl_init(); curl_setopt($ch2, CURLOPT_URL, $url2); curl_setopt($ch2, CURLOPT_HEADER, 0); curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch2, CURLOPT_FOLLOWLOCATION, true); ..

Read more

Api Controller public function store(Request $request) { $statistics = Statistics::create($request->all()); return response()->json($statistics, 201); } route Route::get(‘statistics’,[StatisticsController::class,’store’]); CURL Function $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"http://localhost/kdk_local/statistics"); curl_setopt($ch, CURLOPT_POSTFIELDS, "game_id=3&user_id=3&bet=3&win=3&session_id=3"); curl_exec($ch); curl_close($ch); Sourc..

Read more

I am very new to PHP(Laravel) and got some project. This is the explanation: One device exists someplace and it gathers some data. My project needs to log in to the device and need to get data by JSON file. I used this code for that work: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "$url.0.json"); curl_setopt($ch, CURLOPT_USERPWD, ..

Read more