• Stars
    star
    100
  • Rank 340,703 (Top 7 %)
  • Language
    C#
  • License
    MIT License
  • Created about 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A collection of HTTP status code action results and controller extension methods for ASP.NET Core MVC projects.

AspNetCore.Mvc.HttpActionResults  AspNetCore.Mvc.HttpActionResults - HTTP
  status code results for ASP.NET Core MVC
 

====================================

AspNetCore.Mvc.HttpActionResults is a collection of HTTP status code action results and controller extension methods for ASP.NET Core MVC. Implemented as per the HTTP status code specifications.

Installation

You can install this library using NuGet into your project (or reference it directly in your project.json file). There is no need to add any namespace usings since the package uses the default ones to add extension methods.

Install-Package AspNetCore.Mvc.HttpActionResults

This package will include all available action results and extension methods in your test project. If you prefer, you can be more specific by including only some of the packages.

Action results packages:

  • AspNetCore.Mvc.HttpActionResults.Informational - Contains Informational (1xx) HTTP action results
  • AspNetCore.Mvc.HttpActionResults.Success - Contains Success (2xx) HTTP action results
  • AspNetCore.Mvc.HttpActionResults.Redirection - Contains Redirection (3xx) HTTP action results
  • AspNetCore.Mvc.HttpActionResults.ClientError - Contains Client Error (4xx) HTTP action results
  • AspNetCore.Mvc.HttpActionResults.ServerError - Contains Server Error (5xx) HTTP action results

ControllerBase extension methods packages:

  • AspNetCore.Mvc.HttpActionResults.Informational.Extensions - Contains Informational (1xx) HTTP extension methods
  • AspNetCore.Mvc.HttpActionResults.Success.Extensions - Contains Success (2xx) HTTP extension methods
  • AspNetCore.Mvc.HttpActionResults.Redirection.Extensions - Contains Redirection (3xx) HTTP extension methods
  • AspNetCore.Mvc.HttpActionResults.ClientError.Extensions - Contains Client Error (4xx) HTTP extension methods
  • AspNetCore.Mvc.HttpActionResults.ServerError.Extensions - Contains Server Error (5xx) HTTP extension methods

How to use

After the downloading is complete, you can use the provided action results and controller extension methods.

Available action results:

// 100 Continue
ContinueResult

// 101 Switching Protocols
SwitchingProtocolsResult

// 203 Non-Authoritative Information
NonAuthoritativeInformationResult

// 205 Reset Content
ResetContentResult

// 206 Partial Content
PartialContentResult
PartialContentObjectResult

// 300 Multiple Choices
MultipleChoicesResult
MultipleChoicesObjectResult

// 303 See Other
SeeOtherResult
SeeOtherObjectResult

// 304 Not Modified
NotModifiedResult

// 305 Use Proxy
UseProxyResult

// 305 Temporary Redirect
TemporaryRedirectResult
TemporaryRedirectObjectResult

// 402 Payment Required
PaymentRequiredResult

// 405 Method Not Allowed
MethodNotAllowedResult

// 406 Not Acceptable
NotAcceptableResult
NotAcceptableObjectResult

// 407 Proxy Authentication Required
ProxyAuthenticationRequiredResult

// 408 Request Timeout
RequestTimeoutResult

// 409 Conflict
ConflictResult
ConflictObjectResult

// 410 Gone
GoneResult

// 411 Length Required
LengthRequiredResult

// 412 Precondition Failed
PreconditionFailedResult
PreconditionFailedObjectResult

// 413 Request Entity Too Large
RequestEntityTooLargeResult

// 414 Request URI Too Long
RequestUriTooLongResult

// 415 Unsupported Media Type
UnsupportedMediaTypeResult

// 418 Im A Teapot
ImATeapotResult

// 500 Internal Server Error
InternalServerErrorResult
ExceptionResult

// 501 Not Implemented
NotImplementedResult

// 502 Bad Gateway
BadGatewayResult

// 503 Service Unavailable
ServiceUnavailableResult

// 504 Gateway Timeout
GatewayTimeoutResult

// 505 HTTP Version Not Supported
HTTPVersionNotSupportedResult

Available ControllerBase extension methods:

// returns 100 Continue
controller.Continue();

// returns 101 Switching Protocols
controller.SwitchingProtocols(upgradeValue);

// returns 203 Non-Authoritative Information
controller.NonAuthoritativeInformation();

// returns 205 Reset Content
controller.ResetContent();

// returns 205 Partial Content
controller.PartialContent();

// returns 205 Partial Content with formatted value
controller.PartialContent(someObject);

// returns 300 Multiple Choices
controller.MultipleChoices();

// returns 300 Multiple Choices with formatted value
controller.MultipleChoices(someObject);

// returns 303 See Other
controller.SeeOther();

// returns 303 See Other with Location header
controller.SeeOther(someUri);

// returns 303 See Other with formatted value
controller.SeeOther(someObject);

// returns 303 See Other with Location header and formatted value
controller.SeeOther(someUri, someObject);

// returns 304 Not Modified
controller.NotModified();

// returns 305 Use Proxy with Location header(containing the proxy URI)
controller.UseProxy(proxyUri);

// returns 307 Temporary Redirect wtih Location header
controller.TemporaryRedirect(temporaryUri);

// returns 307 Temporary Redirect wtih Location header and formatted value
controller.TemporaryRedirect(someObject, temporaryUri);

// returns 402 Payment Required
controller.PaymentRequired();

// returns 405 Method Not Allowed
controller.MethodNotAllowed();

// returns 406 Not Acceptable
controller.NotAcceptable();

// returns 406 Not Acceptable with formatted value
controller.NotAcceptable(someObject);

// returns 407 Proxy Authentication Required witch Proxy-Authenticate header
controller.ProxyAuthenticationRequired(proxyAuthenticate);

// returns 408 Request Timeout
controller.RequestTimeout();

// returns 409 Conflict
controller.Conflict();

// returns 409 Conflict with formatted value
controller.Conflict(someObject);

// returns 410 Gone
controller.Gone();

// returns 411 Length Required
controller.LengthRequired();

// returns 412 Precondition Failed
controller.PreconditionFailed();

// returns 412 Precondition Failed with formatted value
controller.PreconditionFailed(someObject);

// returns 413 Request Entity Too Large
controller.PreconditionFailed();

// returns 413 Request Entity Too Large with Retry-After header
controller.PreconditionFailed(retryAfter);

// returns 414 Request URI Too Long
controller.RequestUriTooLong();

// returns 415 Unsupported Media Type
controller.UnsupportedMediaType();

// returns 416 Requested Range Not Satisfiable
controller.RequestedRangeNotSatisfiable();

// returns 417 Expectation Failed
controller.ExpectationFailed();

// returns 418 Im A Teapot
controller.ImATeapot();

// returns 500 Internal Server Error
controller.InternalServerError();

// returns 501 Not Implemented
controller.NotImplemented();

// returns 502 Bad Gateway
controller.BadGateway();

// returns 503 Service Unavailable
controller.ServiceUnavailable();

// returns 504 Gateway Timeout
controller.GatewayTimeout();

// returns 505 HTTP Version Not Supported
controller.HTTPVersionNotSupported();

License

Code by Ivaylo Kenov. Copyright 2016 Ivaylo Kenov.

This package has MIT license. Refer to the LICENSE for detailed information.

Any questions, comments or additions?

If you have a feature request or bug report, leave an issue on the issues page or send a pull request. For general questions and comments, use the StackOverflow forum.

More Repositories

1

MyTested.AspNetCore.Mvc

Fluent testing library for ASP.NET Core MVC.
C#
1,724
star
2

MyTested.WebApi

Fluent testing framework for ASP.NET Web API 2.
C#
755
star
3

AspNet.Mvc.TypedRouting

A collection of extension methods providing strongly typed routing and link generation for ASP.NET Core MVC projects.
C#
485
star
4

Architecture-of-ASP.NET-Core-Microservices-Applications

Architecture of ASP.NET Core Microservices Applications
C#
281
star
5

ASP.NET-Server-Architectures

C#
185
star
6

CSharp-Web-Server

C#
185
star
7

Software-Architecture-Series

Become a better software engineer 👈
162
star
8

C-Sharp-Async-Await-In-Detail

JavaScript
156
star
9

ASP.NET-Core-Project-Car-Renting-System

C#
142
star
10

ASP.NET-MVC-Lambda-Expression-Helpers

A collection of extension methods providing strongly typed link generation for ASP.NET MVC 5 projects.
C#
139
star
11

Domain-Driven-Design-with-ASP.NET-Core-Microservices

Domain-Driven Design with ASP.NET Core Microservices
C#
123
star
12

CSharp-ORM-Battle

C#
100
star
13

Docker-From-ABC-To-XYZ

93
star
14

Identity-Server-Demystified

C#
93
star
15

Let-s-Get-Functional-With-C-Sharp

C#
86
star
16

MyCoolWebServer

C#
84
star
17

Microservice-Based-Applications

80
star
18

Microservices-Eventual-Consistency-Done-Right

C#
79
star
19

Process-Automation-with-ASP.NET-Core-Microservices

C#
75
star
20

C-Sharp-API-Scenarios-REST-GraphQL-gRPC

C#
64
star
21

GameStoreSimpleMvc

C#
55
star
22

JustChess

Console Chess Game for the OOP course at Telerik Academy
C#
54
star
23

MyTested.HttpServer

Fluent testing framework for remote HTTP servers.
C#
51
star
24

Ticketing-System-ASP.NET-MVC-5

Exam preparation for the Telerik Academy ASP.NET MVC 5 course.
C#
46
star
25

Telerik-Academy-Courses

MEAN Stack Application
CSS
45
star
26

Music-Artists

JavaScript
38
star
27

TestRepoCode

Testing GitHub
C#
36
star
28

express-architecture

JavaScript
36
star
29

express-template

Per type architecture for Node.js, Express, Mongoose and Handlebars.
JavaScript
35
star
30

AzurePipelinesBlog

C#
34
star
31

LearningSystemDemo

C#
32
star
32

ModPanel

C#
31
star
33

Jetpack-Joyride-Unity-3D

C#
30
star
34

Cool-Demo-Project

This is my cool demo project for a SoftUni lecture!
C#
27
star
35

AngularJS-SocialNetwork

JavaScript
25
star
36

ExpressionTrees

C#
25
star
37

ivaylokenov

24
star
38

Telerik-Academy-Tasks

My programming experience at Telerik Academy
JavaScript
23
star
39

Flappy-Bird-Unity-3D

C#
20
star
40

TestGitRepo

This is a test repository.
20
star
41

mocking-demo

C#
19
star
42

EasyPTC

C#
19
star
43

Student-System-Live-Demo

Entity Framework Code First and Repository Pattern Live Demo
JavaScript
18
star
44

DynamicXMLBuilder

C#
18
star
45

MVC.Models

JavaScript
17
star
46

TelerikHackaton.Ruler

C#
16
star
47

Roslyn-Overview

Overview of the .NET Compiler Platform
C#
16
star
48

Street-Fitness-Kendo-Mobile

KendoMobileStreetFitness
JavaScript
13
star
49

SoftUniDemoGitHubProject

Demo project for SoftUni Fundamentals
12
star
50

TestGit

Using this repository for a GitHub lecture at SoftUni
JavaScript
10
star
51

FundamentalsGitHubDemo

This is a demo repository for a lecture at SoftUni.
JavaScript
4
star