Unable to pass query string parameters to .NET Core Web API running in Lambda #1166
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@sudarshankonge Could you try the URL https://xxxxxxx-api.ap-south-1.amazonaws.com/Dev/api/v1/stock-exchange/nse/time-series/INFY?start=2022-04-26&end=2022-04-30 (notice capital |
Beta Was this translation helpful? Give feedback.
-
@sudarshankonge Somehow I'm unable to reproduce the issue. Here are the brief steps used for testing:
using Microsoft.AspNetCore.Mvc;
namespace LambdaWebAPINet6_Issue1164.Controllers;
[Route("api/[controller]")]
public class ValuesController : ControllerBase
{
[ProducesResponseType(typeof(TimeSeriesResponse), StatusCodes.Status200OK)]
[HttpGet("/api/v1/stock-exchange/{stockExchange}/time-series/{stockExchangeSymbol}")]
public ActionResult<TimeSeriesResponse> GetTimeSeries(
[FromRoute] string stockExchange,
[FromRoute] string stockExchangeSymbol,
[FromQuery] DateTime start,
[FromQuery] DateTime end)
{
return new TimeSeriesResponse() { StockExchange = stockExchange, StockExchangeSymbol = stockExchangeSymbol, Status = "OK" };
}
public class TimeSeriesResponse
{
public string? StockExchange { get; set; }
public string? StockExchangeSymbol { get; set; }
public string? Status { get; set; }
}
}
I didn't had to define query string parameters in API gateway settings. Kindly note that the stage names are case sensitive. So the URL Thanks, |
Beta Was this translation helpful? Give feedback.
@sudarshankonge Somehow I'm unable to reproduce the issue. Here are the brief steps used for testing:
ValuesController
with the following code: