Extensions methods for Http related objects.
Converts the IFormFile into a BinaryAttachment.
public BinaryAttachment BinaryAttachment(file)
A BinaryAttachment to store the IFormFile.
Name | Type | Summary |
---|---|---|
file | IFormFile | The IFormFile to convert. |
Check an IFormFile is actually an image.
public Boolean IsImage(file)
true if it's an image, otherwise false.
Name | Type | Summary |
---|---|---|
file | IFormFile | An IFormFile. |
Checks whether the request is has the X-Requested-With header setted to XMLHttpRequest.
public Boolean IsXHR(request)
true if the header is present otherwise false.
Name | Type | Summary |
---|---|---|
request | HttpRequest | The HttpRequest to test. |
In this document