Brent W
Well-known member
Trying to wrap my head around this. Making a get request is pretty simple for just a thread.
Using this documentation: https://guzzle.readthedocs.io/en/latest/quickstart.html
Using this within Wordpress.
Working get request:
How would I use POST to create a thread with the required parameters as well as an array of tags?
Using this documentation: https://guzzle.readthedocs.io/en/latest/quickstart.html
Using this within Wordpress.
Working get request:
PHP:
<?php
define("WP_USE_THEMES", false);
require_once('/home/nginx/domains/bamapolitics.com/public/wp-blog-header.php');
require_once('/home/nginx/domains/bamapolitics.com/vendor/autoload.php');
use GuzzleHttp\Client;
$client = new Client([
// Base URI is used with relative requests
'base_uri' => 'https://forum.bamapolitics.com/api/',
// You can set any number of default request options.
'timeout' => 2.0,
'headers' => ['XF-Api-Key' => '<key>']
]);
$response = $client->request('GET', 'threads/2/');
$body = json_decode($response->getBody(), true);
dump($body);
How would I use POST to create a thread with the required parameters as well as an array of tags?
Last edited: