Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

why HttpMethods are not constants? #868

Closed
Bartmax opened this issue Jun 10, 2017 · 2 comments
Closed

why HttpMethods are not constants? #868

Bartmax opened this issue Jun 10, 2017 · 2 comments

Comments

@Bartmax
Copy link

Bartmax commented Jun 10, 2017

I was trying to use HttpMethods as parameters for an Attribute and found out those are not constants but readonly. why aren't const?

public static readonly string Connect = "CONNECT";
public static readonly string Delete = "DELETE";
public static readonly string Get = "GET";
public static readonly string Head = "HEAD";
public static readonly string Options = "OPTIONS";
public static readonly string Patch = "PATCH";
public static readonly string Post = "POST";
public static readonly string Put = "PUT";
public static readonly string Trace = "TRACE";

https://github.com/aspnet/HttpAbstractions/blob/dev/src/Microsoft.AspNetCore.Http.Abstractions/HttpMethods.cs#L10-L18

@kevinchalet
Copy link
Contributor

Because @davidfowl said no, for obscure reasons: #712 :trollface:

@Bartmax
Copy link
Author

Bartmax commented Jun 11, 2017

oh ok. well, if it was intentional I can live with it. not able to use them as attribute params was a bummer tho.

@Bartmax Bartmax closed this as completed Jun 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants