HttpExtensions

Extensions methods for Http related objects.

Namespace:
Inetdev.AspNetCore
Type:
Class
Public:
Yes
Protected:
No
Sealed:
Yes
Abstract:
Yes
Inherits from:
System.Object

Methods

BinaryAttachment

Converts the IFormFile into a BinaryAttachment.

Signature:
public BinaryAttachment BinaryAttachment(file)
Returns

A BinaryAttachment to store the IFormFile.

Parameters
Name Type Summary
file IFormFile The IFormFile to convert.

IsImage

Check an IFormFile is actually an image.

Signature:
public Boolean IsImage(file)
Returns

true if it's an image, otherwise false.

Parameters
Name Type Summary
file IFormFile An IFormFile.

IsXHR

Checks whether the request is has the X-Requested-With header setted to XMLHttpRequest.

Signature:
public Boolean IsXHR(request)
Returns

true if the header is present otherwise false.

Parameters
Name Type Summary
request HttpRequest The HttpRequest to test.