Working on a file upload endpoint and the response is coming back as HTML instead of JSON. If I set the response ContentType = application/json
it sends back a JSON object but the responseText is the HTML that would have been returned. Not sure what I’ve done differently to cause this? The DTOs are:
Request DTO
[Route("/fileReferences", "POST OPTIONS")]
public class CreateFileReferenceRequest
{
public string Slug { get; set; } // not used
}
Response DTO
public class IFileReferenceResponse
{
public List<File> Files { get; set; }
}
public class FileReferenceBySlugResponse : IFileReferenceResponse
{
public FileReference FileReference { get; set; }
}
FileReference
is just a POCO.
To set the response contentType I’m using base.Response.ContentType = 'application/json';