• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

I'm trying to use curl with php but getting this error:Could not resolve host: Bearer

phpcurl


PHP Snippet 1:

<?php
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://api.storekit.itunes.apple.com/inApps/v1/subscriptions/{original_transaction_id}');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');


$headers = array();
$headers[] = 'Authorization: Bearer '. $jwt;
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
var_dump($result);
curl_close($ch);

Related Snippets

Laravel Blade checkbox not checked

How can I pass the list to the component variable in Laravel?

Saving Data from form to database using AngularJS and php

protect my blog content

How to get page number on dompdf PDF when using "view"

What's the net::ERR_HTTP2_PROTOCOL_ERROR about?

How to use functions that are declared in snippets in Evolution CMS (Modx) in an external PHP Script?

Live search query using JS and PHP for QA forum

Additional price based on cart item count in WooCommerce

Fetch files from next cloud storage and display in Laravel website

Exception thrown during the rendering of a template("Parameter "id" for route "url" must match "[^/]++" ("" given) to generate a corresponding URL.")

Unable to create lockable file - Laravel 8 & PHP 8

Star rating with half star support

How to Make Laravel Eloquent "IN" Query?

Hi, I am making a contact form thingy, and my php isn't working any reason why?

About Contact Privacy policy Terms and conditions