如何搜索 GitHub 用户与位置有空间

How to search GitHub user with location has space

本文关键字:用户 位置 空间 GitHub 何搜索 搜索      更新时间:2023-09-26

对 GitHub API 的请求非常简单

https://api.github.com/search/users?q=+location:Hong%20Kong&page=1&per_page=100

通过这个请求,我想找出当前在"香港"的GitHub用户。

但是结果返回

与预期不符,它没有返回我的同事GitHub结果。如果我将"香港"更改为"香港",结果很好。是否有任何空格字符未在其 Web 请求中表示为 %20?

您可能应该用引号封装位置:"香港"。

https://api.github.com/search/users?q=+location:%22Hong%20Kong%22&page=1&per_page=100

(其中%22是 URl 编码形式的"