-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added map with status texts #214
Conversation
@@ -2,6 +2,7 @@ package sttp.model | |||
|
|||
import internal.Validate._ | |||
|
|||
// TODO: When moving to v2 add status text as field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well this models a status code, why would it include a status text? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As if I think correctly status text is to a degree part of status code as it should be same as name of status code https://developer.mozilla.org/en-US/docs/Web/API/Response/statusText
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me it looks as if it's a different property on a Response
class, which can be usually calculated from the status code, but definitely not part of it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, fixes incoming
NetworkAuthenticationRequired -> "Network Authentication Required" | ||
) | ||
|
||
def get(statusCode: StatusCode): String = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to return an Option
ale let the user decide what to do if it's a non-standard status code.
Are these texts "default" descriptions, that is, might they differ in actual server responses? Why would need this map in the first place? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so maybe let's call this method StatusTexts.default(StatusCode)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
Thanks :) |
Base for softwaremill/sttp#1451. I would like to add set of status text here and use them in sttp core
Response
.