You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Github API requires user-agent-header and without it, it returns a 403 reponse, ultimately resulting in vague decoding errors that could be difficult to debug for trying out the examples.
Github API requires
user-agent-header
and without it, it returns a403
reponse, ultimately resulting in vague decoding errors that could be difficult to debug for trying out the examples.For instance, the code snippet in https://rust-lang-nursery.github.io/rust-cookbook/web/clients/apis.html#query-the-github-api results in following error.
403 due to missing user-agent-header
Solution:
One of the fixes for above is to use
reqwest client
and pass inuser-agent-header
along with the request such as below.Related: seanmonstar/reqwest#1516
The text was updated successfully, but these errors were encountered: