{"id":339,"date":"2019-11-01T14:24:11","date_gmt":"2019-11-01T14:24:11","guid":{"rendered":"https:\/\/sdf-docs.mansystems.com\/docs\/acr-rules\/maintenance\/webservices-containing-static-endpoints\/"},"modified":"2020-02-24T11:45:03","modified_gmt":"2020-02-24T11:45:03","slug":"staticurlendpoints","status":"publish","type":"docs","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/maintainability\/staticurlendpoints","title":{"rendered":"URL endpoints should not be hard-coded"},"content":{"rendered":"\n<p>When calling REST or web (SOAP) services it is a bad practice to hard-code the endpoints. Endpoints can change and it is very likely that different endpoints need to be used for test and production. In both of these use cases, it is preferable to use a constant for the endpoint.<\/p>\n\n\n\n<p><strong>Noncompliant solution:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"777\" height=\"543\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/01\/image-69.png\" alt=\"\" class=\"wp-image-1026\" srcset=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/01\/image-69.png 777w, https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/01\/image-69-480x335.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 777px, 100vw\" \/><\/figure>\n\n\n\n<p><strong>Compliant solution:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"776\" height=\"546\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/01\/image-70.png\" alt=\"\" class=\"wp-image-1027\" srcset=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/01\/image-70.png 776w, https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/01\/image-70-480x338.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 776px, 100vw\" \/><\/figure>\n","protected":false},"featured_media":0,"parent":98,"menu_order":7,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-339","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/339"}],"collection":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=339"}],"version-history":[{"count":4,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/339\/revisions"}],"predecessor-version":[{"id":1028,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/339\/revisions\/1028"}],"up":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/98"}],"next":[{"title":"Entity should have a maximum of N associations","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/maintainability\/amountassociations","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/309"}],"prev":[{"title":"The latest Mendix version should be used","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/maintainability\/latestmendixverion","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/515"}],"wp:attachment":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=339"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}