Question

I am developing a client to access weather information from a RESTful API (http://api.worldweatheronline.com/free/v1/weather.ashx). I am using ASP.NET MVC4 and i have two choices as of my limited knowledge.

  1. using jQuery.ajax({....});
  2. using .NET4.0 HttpClient.

The API requires a key parameter key=xxxxxxxxxxxx as part of the request, and i do not want to reveal the key to the users of the site.

Please guide me someone and also let me know if there are some best practices/standard way of doing this?

Was it helpful?

Solution

If you don't want to reveal the key to users of the site, then you have no choice but to use HttpClient from within your ASP.NET web site. If you allow the call to be made by jQuery in the client browser then it is impossible to hide that key.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top