function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
riffindusriffindus 

Best practices for providing endpoint for HTTP rest services

Hi,

 

I did a successfull HTTP Post to an endpoint. i know it is not a good practise to hardcode the endpoint URL in the code itself. Is there anyway i can keep it globally and change it whenever we want. Please let me know. how others use it, so that i can implement the same. 

 

please provide your inputs



Best Answer chosen by Admin (Salesforce Developers) 
sfdcfoxsfdcfox

Most REST services have an established API, including discovery services, so your question may be irrelevant for those services (e.g. salesforce.com's REST API). For others, though, you might just use a "custom setting" (Setup > Develop > Custom Settings) to store this information.

All Answers

sfdcfoxsfdcfox

Most REST services have an established API, including discovery services, so your question may be irrelevant for those services (e.g. salesforce.com's REST API). For others, though, you might just use a "custom setting" (Setup > Develop > Custom Settings) to store this information.

This was selected as the best answer
riffindusriffindus

Hi

 

Thanks for the reply. I will create a field to set URL in it.

 

But just wondering, how to provide value in it?

 

riffindusriffindus

I figured out providing values for the fields and using the same.

 

Thanks once again.