Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
536 B
2
Indexable
$client = new GuzzleHttp\Client();
            $response = $client->request('POST', $url . '/wp-json/wp/v2/media', [
                'form_params' => [
                    'source_url' => $resimadres
                ],
                'headers' => [
                    'Authorization' => 'Basic ' . base64_encode($username . ':' . $password),
                    'Content-Type' => 'image/jpeg',
                    'Content-Disposition' => 'attachment; filename=' . basename($resimadres). ''
                ]
            ]);