Answer the question
In order to leave comments, you need to log in
Is there a convenient library for working with the REST API?
Can you please tell me if there is a convenient library for organizing requests and receiving responses from the server with the rest api?
Interested in a ready-made wrapper for something like this:
// Set the url, number of GET vars, GET data
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// Execute request
$result = curl_exec($ch);
// Close connection
curl_close($ch);
// get the result and parse to JSON
$responce = json_decode($result, true);
Answer the question
In order to leave comments, you need to log in
Wrap your code in a function and you will have a library for working with the rest api.
And in general, it googles on request php rest client, it already depends on your taste, what you like more
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question