Skip to content
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

Export statustext function. #685

Closed
AtsushiSakai opened this issue Feb 27, 2021 · 3 comments · Fixed by #688
Closed

Export statustext function. #685

AtsushiSakai opened this issue Feb 27, 2021 · 3 comments · Fixed by #688

Comments

@AtsushiSakai
Copy link
Contributor

I think statustext function would be useful in some client codes.

"""
statustext(::Int) -> String
`String` representation of a HTTP status code. e.g. `200 => "OK"`.
"""
statustext(status) = Base.get(STATUS_MESSAGES, status, "Unknown Code")

Is there any plan to export it and update doc related it?

Julia 1.5.2
HTTP.jl 0.9.5

@quinnj
Copy link
Member

quinnj commented Feb 27, 2021

I kind of like keeping the exports to a minimum; what needs to update in the doc?

@AtsushiSakai
Copy link
Contributor Author

AtsushiSakai commented Feb 27, 2021

Thank you for your comment.

I kind of like keeping the exports to a minimum;

Yes, I agree that it should be. However, in my case, I always needs to implement the similar codes of the statustext and STATUS_MESSAGE...

what needs to update in the doc?

Just adding it’s doc in public interface section https://juliaweb.github.io/HTTP.jl/dev/public_interface/
And adding a example for the function might be good for better documentation, I think.

@quinnj
Copy link
Member

quinnj commented Feb 27, 2021

Yeah, that all sounds good to me; mind making a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants