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

Use HEAD request to test whether endpoint exists #109

Closed
dtolnay opened this issue May 17, 2017 · 2 comments
Closed

Use HEAD request to test whether endpoint exists #109

dtolnay opened this issue May 17, 2017 · 2 comments

Comments

@dtolnay
Copy link
Member

dtolnay commented May 17, 2017

For example, check whether a particular GitHub user exists: https://api.github.com/users/ferris-the-crab

@gsquire
Copy link
Contributor

gsquire commented May 18, 2017

I can do this one using the reqwest crate.

@dtolnay
Copy link
Member Author

dtolnay commented May 18, 2017

Great! Here is a method to make a HEAD request and GitHub should respond with 200 if the user exists and 404 if the user does not exist (or come up with your own better use case).

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

No branches or pull requests

2 participants