所以我正在尝试进行集成测试以测试文件上载量。我使用此文档作为参考:https://docs.microsoft.com/en-us/aspnet/core/testing/integration-testing?view=aspnetcore-2.1
PostResponse1和PostResponse2给了我一个404但getResponse给了我200个有效数据。
我正在尝试获取访问令牌以供进一步使用。 以下是Authenticate方法的方法体:
[Route("api/[controller]/[action]")]
public class TokenAuthController : TenantApiControllerBase
{
[HttpPost]
public async Task<AuthenticateResultModel> Authenticate([FromBody] AuthenticateModel pModel)
{
AbpLoginResult<Tenant, User> loginResult = await GetLoginResultAsync(
pModel.UserNameOrEmailAddress,
pModel.Password,
GetTenancyNameOrNull()
);
string accessToken = CreateAccessToken(CreateJwtClaims(loginResult.Identity));
return new AuthenticateResultModel
{
AccessToken = accessToken,
EncryptedAccessToken = GetEncrpyedAccessToken(accessToken),
ExpireInSeconds = (int)this._configuration.Expiration.TotalSeconds,
UserId = loginResult.User.Id
};
}
为什么getAsync给我一个200但PostAsJsonAsync给我一个404?