Skip to main content
edited tags
Link
Samuel De Rycke
  • 9.6k
  • 8
  • 46
  • 73
deleted 2 characters in body; edited tags
Source Link
Vamsi Krishna Gosu
  • 10.5k
  • 5
  • 33
  • 50

I'm using cloudinary to store images. when I try to delete a ressourceresource, I get the following error message: HTTP method DELETE doesn't support output.

HTTP method DELETE doesn't support output.

my source code:

     Http h = new Http();
     HttpRequest req = new HttpRequest();
     req.setEndpoint('http://api.cloudinary.com/v1_1/'+cloudname+'/image/upload');
     req.setMethod('DELETE');
     String myData = 'public_id=myPublicId';
     Blob hash = Crypto.generateDigest('SHA1',Blob.valueOf(myData));
     String hexDigest = EncodingUtil.convertToHex(hash);
     String finalBodyString='public_id=myPublicId&api_key='+apikey+'&timestamp='+EncodingUtil.urlEncode(tiStmp, 'UTF-8')+'&signature='+EncodingUtil.urlEncode(hexDigest, 'UTF-8');
    req.setBody(finalBodyString);
    HttpResponse res = h.send(req);

I'm using cloudinary to store images. when I try to delete a ressource, I get the following error message: HTTP method DELETE doesn't support output.

my source code:

     Http h = new Http();
     HttpRequest req = new HttpRequest();
     req.setEndpoint('http://api.cloudinary.com/v1_1/'+cloudname+'/image/upload');
     req.setMethod('DELETE');
     String myData = 'public_id=myPublicId';
     Blob hash = Crypto.generateDigest('SHA1',Blob.valueOf(myData));
     String hexDigest = EncodingUtil.convertToHex(hash);
     String finalBodyString='public_id=myPublicId&api_key='+apikey+'&timestamp='+EncodingUtil.urlEncode(tiStmp, 'UTF-8')+'&signature='+EncodingUtil.urlEncode(hexDigest, 'UTF-8');
    req.setBody(finalBodyString);
    HttpResponse res = h.send(req);

I'm using cloudinary to store images. when I try to delete a resource, I get the following error message:

HTTP method DELETE doesn't support output.

my source code:

     Http h = new Http();
     HttpRequest req = new HttpRequest();
     req.setEndpoint('http://api.cloudinary.com/v1_1/'+cloudname+'/image/upload');
     req.setMethod('DELETE');
     String myData = 'public_id=myPublicId';
     Blob hash = Crypto.generateDigest('SHA1',Blob.valueOf(myData));
     String hexDigest = EncodingUtil.convertToHex(hash);
     String finalBodyString='public_id=myPublicId&api_key='+apikey+'&timestamp='+EncodingUtil.urlEncode(tiStmp, 'UTF-8')+'&signature='+EncodingUtil.urlEncode(hexDigest, 'UTF-8');
    req.setBody(finalBodyString);
    HttpResponse res = h.send(req);
Source Link

Delete a ressource from cloudinary

I'm using cloudinary to store images. when I try to delete a ressource, I get the following error message: HTTP method DELETE doesn't support output.

my source code:

     Http h = new Http();
     HttpRequest req = new HttpRequest();
     req.setEndpoint('http://api.cloudinary.com/v1_1/'+cloudname+'/image/upload');
     req.setMethod('DELETE');
     String myData = 'public_id=myPublicId';
     Blob hash = Crypto.generateDigest('SHA1',Blob.valueOf(myData));
     String hexDigest = EncodingUtil.convertToHex(hash);
     String finalBodyString='public_id=myPublicId&api_key='+apikey+'&timestamp='+EncodingUtil.urlEncode(tiStmp, 'UTF-8')+'&signature='+EncodingUtil.urlEncode(hexDigest, 'UTF-8');
    req.setBody(finalBodyString);
    HttpResponse res = h.send(req);