Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

asp.net core httpdelete with body

public class AddMissingContentType : Attribute, IResourceFilter
{
    public void OnResourceExecuting(ResourceExecutingContext context)
    {
        context.HttpContext.Request.Headers["Content-Type"] = "application/json";
    }

    public void OnResourceExecuted(ResourceExecutedContext context)
    {
    }
}
And add it to your method:

[AddMissingContentType]
[HttpDelete]
public async Task<IActionResult> Delete([FromBody]RequestData request)
{
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to use mongodb search index in c# 
Csharp :: Startup.cs file 
Csharp :: c# rotate sum array 
Csharp :: taskcontinuationoptions.onlyonfaulted 
Csharp :: check if variable less than in f# 
Csharp :: telerik mvc grid editable date no time 
Csharp :: search list for words c# 
Csharp :: "; expected" error c#$ 
Csharp :: unity check if swipe not tap 
Csharp :: tuple parameter name 
Csharp :: c# KERNEL32.DLL recoverdeleted files 
Csharp :: We create a PdfDocument, not a (MigraDoc) Document 
Csharp :: CefSharp.Core in clickones application 
Csharp :: read barcode with barcode scanner c# winform serial port number 
Csharp :: c# print 1 to 100 
Csharp :: c# fileinfo filename without extension 
Csharp :: calculated field gridview asp.net 
Csharp :: What is the best way to lock cache in asp.net? 
Csharp :: .net disable show exception 
Csharp :: basic math functions in c# 
Csharp :: parsing object from text file c# 
Csharp :: netmath hack console 
Csharp :: EntityFramework: using tables in different scemas 
Csharp :: Unity SceneLoad by Name in Inspector 
Csharp :: how to set an expiry date on a program 
Csharp :: c# control datagridview null value 
Csharp :: id dublication exception c# .net core 
Csharp :: asp.net render control to string 
Csharp :: create entity c# d365 
Csharp :: c# make two checkbox uncheckable both 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =