How can I use HttpFactory in Joomla?
I used curl in Joomla, curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'X-API-KEY:' . $api_key, 'X-SANDBOX:' . $sandbox, )); but now I use HttpFactory for request to api: $options = array( 'Content-Type: application/json', 'X-API-KEY:' . $api_key, 'X-SANDBOX:' . $sandbox, ); $answer = $this->http->post($url,json_encode($data,true),$options); my result body is : Unsupported request content type application/x-www-form-urlencoded" why?
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.