Skip to Content
avatar image
Former Member

How to add url for post request without hard coding it

Error is: ESLint (sap-no-harcoded-url): Hardcoded (non relative) URL found. Category Fiori Architectural guidelines

sending post request from SAP Fiori app developed on SAP WEB IDE

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Dec 13, 2017 at 04:49 PM

    Here is how you do it

    add it to the i18.properties file as follows

    #XLNK: 
    Login = [your full app url]
    

    and invoke it from the controller

    var oView = sap.ui.getCore().byId("[your view id]");
    var oResourceBundle = oView.getModel("i18n").getResourceBundle();
    var url = oResourceBundle.getText("Login").toString().trim();
    
    Add comment
    10|10000 characters needed characters exceeded