Android Question How to implement Curl in B4A

mcqueccu

Well-Known Member
Licensed User
Longtime User
I got this API and I need help implementing it with okhttputils2 with an example code

B4X:
<?php
$url = 'https://test.easydrive.com/api_call.php';

$additional_headers = array('Content-Type: application/json');

$ch = curl_init($url);                                                                     
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); // $data is the request payload                                                                 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                     
curl_setopt($ch, CURLOPT_HTTPHEADER, $additional_headers);

$server_output = curl_exec ($ch);
?>
 

DonManfred

Expert
Licensed User
Longtime User
Use okHttputils2 to call the api.
Search the forum about example. There are plenty...
 
Upvote 0
Top