Multiple HTTP Methods for one API Method/URL

Hi all,
at the moment I’m trying to develop a small API with codeless to store and load custom data in backendless. In our design and concept of the API we wanted to have one URL/Method per datatype.
So simplified lets say I want to store a picture out of my software in backendless and load it later. For this we wanted to have a URL like: domain.tdl/api/<version>/picture/binary. At the moment in codeless I don’t find a way to have multiple HTTP methods (GET, POST, PUT, DELETE) per URL/API method.
Am I missing something? Or will be a way to do so? Otherwise we poorly have to change that in our concept, as I like the fact to have one URL and not multiple URLs like: /picture/getbinary, /picture/putbinary, /picture/deletebinary

Hi Jonas

When you create/update your Codeless Method

  • you have to define UNIQUE method name in your API Service
  • but you can specify the same route with different Rest Method (GET, POST, PUT, DELETE);/img&gt;

so, in your case you need to create 4 Methods in your Service

  1. [ name: “GetPicture”, method: “GET”, route: “/picture/binary” ]
  2. [ name: “CreatePicture”, method: “POST”, route: “/picture/binary” ]
  3. [ name: “UpdatePicture”, method: “PUT”, route: “/picture/binary” ]
  4. [ name: “DeletePicture”, method: “DELETE”, route: “/picture/binary” ];/img&gt;

and you can call the method by this routes:

GET: https://{DOMAIN}/{APP ID}/{API KEY}/services/{SERVICE NAME}/picture/binary

POST: https://{DOMAIN}/{APP ID}/{API KEY}/services/{SERVICE NAME}/picture/binary

PUT: https://{DOMAIN}/{APP ID}/{API KEY}/services/{SERVICE NAME}/picture/binary

DELETE: https://{DOMAIN}/{APP ID}/{API KEY}/services/{SERVICE NAME}/picture/binary;/img&gt;

Regards, Vlad


Hi Vlad,

thats exactly what I need. Thank you very much.
I thought so far that the route has to be unique as well. But now it’s clear.

Best Regards,