Skip to content

YOUSSEF-YL/WebService--ASP.NET

Repository files navigation

ASP.NET Mini Weather WebService This is a simple ASP.NET WebService that provides basic weather information for a given location. It uses the OpenWeatherMap API to retrieve weather data and exposes a REST API that returns JSON responses.

Requirements To run this WebService, you'll need the following:

Visual Studio 2019 or later .NET Framework 4.7.2 or later An OpenWeatherMap API key Installation Clone this repository or download the ZIP file and extract it to a local folder. Open the solution file (MiniWeatherWebService.sln) in Visual Studio. Replace the placeholder API key in the Web.config file with your own OpenWeatherMap API key. Build the solution (Ctrl + Shift + B) to restore packages and compile the code. Start the WebService by running the project (F5). Usage The WebService exposes a single endpoint (/weather/{location}) that accepts a location parameter and returns weather data for that location in JSON format.

To test the WebService, you can use a tool like Postman or cURL:

bash Copy code curl -X GET http://localhost:port/weather/New%20York Replace port with the actual port number used by the WebService.

The response will be a JSON object with the following properties:

Location: the name of the requested location. Temperature: the current temperature in Celsius. Description: a brief description of the weather conditions (e.g. "clear sky", "light rain"). License This WebService is released under the MIT License. Feel free to use, modify, and distribute it as you see fit. Please refer to the LICENSE file for more information.

Releases

No releases published

Packages

No packages published