Unable to pass query string parameters to .NET Core Web API running in Lambda #1166
Answered
by
ashishdhingra
sudarshankonge
asked this question in
Q&A
Answered by
ashishdhingra
Apr 29, 2022
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 |
0 replies
|
@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, |
0 replies
Answer selected by
ashishdhingra
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment




@sudarshankonge Somehow I'm unable to reproduce the issue. Here are the brief steps used for testing:
ValuesControllerwith the following code: