Purpose of accessing the URL from the web config RRS feed

  • Question

  • User1581715318 posted

    what is the purpose of defining the URL as a key in the web.config file and get it as a variable in the WebAPI? Why can't we use directly the URL in my WebAPI? what are the differences between both of them?

    Thursday, January 18, 2018 3:09 AM


  • User61956409 posted

    Hi yaduska,

    If you make it as hard coded string in your controller actions, every time when you want to change URL, you might need to update it one by one. But if you store that value in your config file rather than as a hard coded string in your code, which will be much easier to change that value.

    With Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 18, 2018 8:22 AM