#### [Abblix\.SecurityEvents\.MinimalApi](https://www.abblix.com/en/docs/api/abblix-securityevents-minimalapi 'index')
### [Abblix\.SecurityEvents\.MinimalApi](https://www.abblix.com/en/docs/api/abblix-securityevents-minimalapi/Abblix.SecurityEvents.MinimalApi 'Abblix\.SecurityEvents\.MinimalApi')

## ResultHeaderExtensions Class

Attaches response headers to a result instead of writing them beside it\.

```csharp
public static class ResultHeaderExtensions
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → ResultHeaderExtensions
### Methods

## ResultHeaderExtensions\.WithHeaders\(this IResult, Action\<IHeaderDictionary\>\) Method {#Abblix.SecurityEvents.MinimalApi.ResultHeaderExtensions.WithHeaders(thisMicrosoft.AspNetCore.Http.IResult,System.Action_Microsoft.AspNetCore.Http.IHeaderDictionary_)}

Returns a result that sets the given headers and then renders
[result](https://www.abblix.com/en/docs/api/abblix-securityevents-minimalapi/Abblix.SecurityEvents.MinimalApi.ResultHeaderExtensions#Abblix.SecurityEvents.MinimalApi.ResultHeaderExtensions.WithHeaders(thisMicrosoft.AspNetCore.Http.IResult,System.Action_Microsoft.AspNetCore.Http.IHeaderDictionary_).result 'Abblix\.SecurityEvents\.MinimalApi\.ResultHeaderExtensions\.WithHeaders\(this Microsoft\.AspNetCore\.Http\.IResult, System\.Action\<Microsoft\.AspNetCore\.Http\.IHeaderDictionary\>\)\.result')\.

```csharp
public static Microsoft.AspNetCore.Http.IResult WithHeaders(this Microsoft.AspNetCore.Http.IResult result, System.Action<Microsoft.AspNetCore.Http.IHeaderDictionary> configure);
```
#### Parameters

###### `result` [Microsoft\.AspNetCore\.Http\.IResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult 'Microsoft\.AspNetCore\.Http\.IResult') {#Abblix.SecurityEvents.MinimalApi.ResultHeaderExtensions.WithHeaders(thisMicrosoft.AspNetCore.Http.IResult,System.Action_Microsoft.AspNetCore.Http.IHeaderDictionary_).result}

The answer being rendered\.

###### `configure` [System\.Action&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.action-1 'System\.Action\`1')[Microsoft\.AspNetCore\.Http\.IHeaderDictionary](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iheaderdictionary 'Microsoft\.AspNetCore\.Http\.IHeaderDictionary')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.action-1 'System\.Action\`1') {#Abblix.SecurityEvents.MinimalApi.ResultHeaderExtensions.WithHeaders(thisMicrosoft.AspNetCore.Http.IResult,System.Action_Microsoft.AspNetCore.Http.IHeaderDictionary_).configure}

Sets the headers on the response\.

#### Returns
[Microsoft\.AspNetCore\.Http\.IResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult 'Microsoft\.AspNetCore\.Http\.IResult')

### Remarks
A header a specification requires belongs to the answer, not to the code path that happened
to produce it\. Written as a statement before the return, it is attached to whichever branch
the author was looking at and quietly missing from the others \- and a header required on a
refusal is required on the branch least often read\. Carried by the result, it travels with
every answer that result stands for\.

The headers are set when the result is executed, which is before anything is written to the
body: a header added after the response has started is dropped, and ASP.NET Core reports
that as an exception rather than as the silent loss it would otherwise be.
