I'm wondering, Is there an option to receive data with @HTTPGET --> Make some manipulation on this data --> Create new REST request and send it to different URL - On the same Class?



Yes, a @HttpPost or @HttpGet method can manipulate what it receives and then make an Http request to a different URL.

If you are asking can that different URL be handled by the same class, that depends on the @RestResource. If that pattern is fixed like this then no:


but if it includes wildcards then yes, though you will need to add code to explicitly handle the various values:


(There is a hacky approach for a fixed URL in that you can write one Apex method for each of the HTTP methods @HttpDelete, @HttpGet, @HttpPatch, @HttpPost, @HttpPut. But that is likely to result in a design that is quite different from the normal REST patterns.)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.