Using a provided Interface part for a 3rd-party REST service

In EGL, you can use the following Interface part to access a third-party REST service:

interface IRest
   function invokeGet(reqURL string in) returns(string)  
      {@getRest {uriTemplate="{reqURL}"}};
   function invokePost(reqURL string in, representation string in) returns(string)
      {@postRest {uriTemplate="{reqURL}"}};
   function invokePut(reqURL string in, representation string in) returns(string)
      {@putRest {uriTemplate="{reqURL}"}};
   function invokeDelete(reqURL string in, representation string in) returns(string) 
      {@deleteRest {uriTemplate="{reqURL}"}};
end

By using this Interface part as is, you do not have to write one. However, you write the call statement with one or two arguments, and you construct the URI in any of the following ways:

When you invoke a service by using the POST, PUT, or DELETE methods, make sure that the representation (a string) is in the format that is required by the REST service. The following functions provide output in the required formats:
You might need a function prototype that has a different characteristic, such as a DELETE operation that does not require you to pass a representation. In that case, create a similar Interface part, but change the InvokeDelete function prototype or add a prototype with a different name. Here is a changed prototype:
function invokeDelete(reqURL string in) returns(string) 
   {@deleteRest {uriTemplate="{reqURL}"}};