After an hour of digging the dotnet documentation, I put this together

This commit is contained in:
TypoMustakes
2023-12-02 16:15:02 +01:00
parent 573fcd14ba
commit 87bfe822a7

View File

@@ -17,7 +17,20 @@ namespace WD7UVN_HFT_2023241.Endpoint
[HttpGet] [HttpGet]
public IActionResult Get() public IActionResult Get()
{ {
return Ok("This is a GET request."); // Accessing individual query parameters
//string paramValue = HttpContext.Request.Query["tableName"];
// Retrieving all query parameters
var queryParams = HttpContext.Request.Query;
foreach (var param in queryParams)
{
string paramName = param.Key;
string paramVal = param.Value;
// Perform operations with paramName and paramVal
}
} }
[HttpPost] [HttpPost]