AndyB
Well-known member
Hello,
The following code works for XF v2.1
	
	
	
		
How would I convert the above code to work in XF v2.0 forums?
Thank you.
				
			The following code works for XF v2.1
		PHP:
	
	// get response
try
{
	$client = \XF::app()->http()->client();
	$response = $client->request('POST', $url, [
		'body' => $json,
		'headers' => [
			'Content-Type' => 'application/json',
			'Content-Length' => strlen($json),
		]
	]);
}
catch (\GuzzleHttp\Exception\RequestException $e)
{
	\XF::logException($e, false, "Similar threads error: ");
	$continue = false;
}How would I convert the above code to work in XF v2.0 forums?
Thank you.
 
 
		
 
 
		 
 
		


 
 
		 
 
		 
					
				 
						
					 
 
		 
 
		