-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe an easy example for purge images in PHP #25
Comments
Simply replace $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.imgix.com/v2/image/purger");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"url\":\"{IMAGE_URL}\"}");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, {API_KEY});
$headers = array();
$headers[] = "Content-Type: application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close ($ch); |
Hmm, I think the desire is to have a method in the SDK that can abstract all this request building away. (I need this as well) |
Hey folks, Sorry for the radio silence in this thread. Adding "native" purging into our core SDK libraries is something we're planning to do in the near-to-medium future. We resisted this for a long time because we didn't think that it was worth "cluttering" the core libraries with something that was easily accomplishable in any language with a native HTTP request, but we've since come around and now agree with @atrauzzi: abstracting the messy, curly bits away from common imgix actions such as purging is exactly what this library should be doing. If anyone wants to take a swing at this we'd happily accept a PR, but otherwise stay tuned 😄. |
Sorry @jayeb, you mark this as completed, I don't see any commit or any docs about a sdk method, only the http default request. |
@zipus I'm no longer working on this project, but I'll tag in @sherwinski here! |
Hey @zipus, |
According to the documentation about purging images it shows an example for purge via Python, but it seems that there is no example in PHP or a method in this SDK library that implements this in a easy way
It is clear that must obey 3 conditions:
In Curl is using like:
The text was updated successfully, but these errors were encountered: