C#C
C#2y ago
Gecko

405 Method Not Allowed

I am receiving a 405 error, with no other relevant log messages. Any ideas what's happening?

Accessor
        public async Task<Response<int>> AddPermit<T>(T permit) where T : PermitDetails
        {
            var response = await _permitAccessor.AddPermit<T>(permit);
            return response;
        }


IPermitClient
    Task<Response<int>> AddPermit<T>(T permit) where T : PermitDetails;


PermitClient
c#
        public async Task<Response<int>> AddPermit<T>(T permit) where T : PermitDetails
        {
            var result = await _http.PostAsJsonAsync("api/permit", permit);
            return await result.Content.ReadFromJsonAsync<Response<int>>();
        }


AddPermit (Frontend code where the PermitClient is called with data)
c#
        PermitClient.AddPermit(Constants.MockPermits.PermitList[0]);


MockPermits.PermitList
c#
        public static PermitDetails[] PermitList = {
            new PermitDetails()
            {
                PermitType = "Mechanical Amusement",
                BusinessDetails = MockBusiness.MockBusinessExample,
                LocationDetails = MockLocation.MockLocationExample,
                Status = "Approved",
                StartDate = new DateTime(2022, 02, 27),
                EndDate = new DateTime(2023, 02, 27),
                Signature = Array.Empty<byte>(),
            },
}


Didn't include the controller, because this error happens before the controller is even reached
Was this page helpful?