You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
so i made a controller like this: application.MapPost("/registration/verify", controller.Verify); public async Task<IResult> Verify( [FromQuery(Name = "token")] string? token, CancellationToken cancellationToken)
and i test it like this with HttpClient from WebApplicationFactory<>:
HttpRequestMessage request = new()
{
Method = HttpMethod.Post,
RequestUri = new Uri("/registration/verify?token=1122334455667789")
};
var response = await client.SendAsync(request);
but it shows this instead:
System.Net.Http.HttpRequestException : Response status code does not indicate success: 404 (Not Found).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
works fine if i dont include the ?token=... part. what am i doing wrong?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
so i made a controller like this:
application.MapPost("/registration/verify", controller.Verify);
public async Task<IResult> Verify( [FromQuery(Name = "token")] string? token, CancellationToken cancellationToken)
and i test it like this with
HttpClient
fromWebApplicationFactory<>
:but it shows this instead:
works fine if i dont include the
?token=...
part. what am i doing wrong?Beta Was this translation helpful? Give feedback.
All reactions