如何调用REST API?

发布于 2024-09-25 17:40:38 字数 502 浏览 0 评论 0原文

我无法理解如何调用 RESTful 服务

更具体地说,我试图从 hxxp://teambox.com/api/user

/api/1/users/:id

我不知道如何实际创建 URL,我应该如何使用 ':id' ?

我尝试过:

http://teambox.com/api/1/users/?123456
http://teambox.com/api/1/users/?id=123456

但它不起作用。 我使用的是从另一个调用收到的整数 id,而不是 12345,所以这不是因为实际的 id。

我只是不知道如何创建带有 ':id' 的 URL

谢谢!

I am having trouble understanding how to call a RESTful service

More specifically, I am trying to call the first API from
hxxp://teambox.com/api/user

/api/1/users/:id

I don't know how to actually create the URL, how should I use ':id' ?

I tried:

http://teambox.com/api/1/users/?123456
http://teambox.com/api/1/users/?id=123456

but it doesn't work.
Instead of 12345 I am using the integer id I receive from another call, so it's not because of the actual id.

I just don't know how to create the URL with ':id'

Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月依秋水 2024-10-02 17:40:38

http://teambox.com/api/1/users/123456 怎么样?

How about http://teambox.com/api/1/users/123456?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文