Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在从此链接获取提要。我只想从提要中获取前五个项目。取而代之的是,我从提要中获取所有项目。我怎样才能只获得前五项?我应该使用 URL 传递任何参数吗?
HTTP.get('https://buzz.machaao.com/feed', (err, res) => { if(err) { console.log(err); } else { console.log(res); } });
不,那是不可能的。您可以做的是https://buzz.machaao.com/latest使用Accept: application/json标头发出 GET 请求。您可以传递一个count参数来限制帖子。
https://buzz.machaao.com/latest
Accept: application/json
count