please see the link (https://reqres.in/) for list of endpoints
This API wrapper use Faraday client, please install faraday client in your local env
gem install faraday
please see the link (https://reqres.in/) for list of endpoints
This API wrapper use Faraday client, please install faraday client in your local env
gem install faraday
use Psr\Http\Message\ServerRequestInterface; | |
function product(ServerRequestInterface $request) | |
{ | |
$name = "Banana"; | |
$phoneNumber = "62812334444" | |
$queryString = $request->getQueryParams(); | |
$name = $queryString['name'] ?? $name; | |
header("Location: https://api.whatsapp.com/send?phone=" . $phoneNumber . "&text=" . $name); |
1xx Informational | |
100 :continue | |
101 :switching_protocols | |
102 :processing | |
2xx Success | |
200 :ok | |
201 :created | |
202 :accepted | |
203 :non_authoritative_information |
# create magick shell command to convert the first page of PDF file into image format | |
# Usage: convert_magic.sh <PDF file> <image format> <output name> | |
# convert_magic.sh input.pdf png output.png | |
# check if the PDF file exists | |
if [ ! -f $1 ]; then | |
echo "File $1 does not exist" | |
exit 1 | |
fi |
<?php | |
// Function to convert a file to base64 | |
function fileToBase64($filePath) { | |
if (file_exists($filePath)) { | |
$fileData = file_get_contents($filePath); | |
if ($fileData !== false) { | |
return base64_encode($fileData); | |
} else { | |
return false; // Error reading file |