使用Rest客户端mozzilla消费Rest Web服务
Consuming Rest webservices using REST client mozzilla
我能够成功地执行对服务的GET请求,现在我想知道如何执行POST、PUT、DELETE命令
通过Rest客户端,我执行了OPTION命令,得到了这个结果
<application>
<doc jersey:generatedBy="Jersey: 1.17 01/17/2013 04:27 PM"/>
<grammars>
<include href= "http://localhost:8081/de.vogella.jersey.todo/rest/application.wadl/xsd0.xsd" >
<doc title="Generated" xml:lang="en"/>
</include>
</grammars>
<resources base="http://localhost:8081/de.vogella.jersey.todo/rest/">
<resource path="todos">
<method id="getTodosBrowser" name="GET">
<response>
<ns2:representation element="todo" mediaType="text/xml"/>
</response>
</method>
<method id="getTodos" name="GET">
<response>
<ns2:representation element="todo" mediaType="application/xml"/>
<ns2:representation element="todo" mediaType="application/json"/>
</response>
</method>
<method id="newTodo" name="POST">
<request>
<representation mediaType="application/x-www-form-urlencoded">
<param name="id" style="query" type="xs:string"/>
<param name="summary" style="query" type="xs:string"/>
<param name="description" style="query" type="xs:string"/>
</representation>
</request>
</method>
<resource path="count">
<method id="getCount" name="GET">
<response>
<representation mediaType="text/plain"/>
</response>
</method>
</resource>
<resource path="{todo}">
<param name="todo" style="template" type="xs:string"/>
<method id="getTodo" name="GET">
<response>
<ns2:representation element="todo" mediaType="application/xml"/>
<ns2:representation element="todo" mediaType="application/json"/>
</response>
</method>
<method id="getTodoHTML" name="GET">
<response>
<ns2:representation element="todo" mediaType="text/xml"/>
</response>
</method>
<method id="putTodo" name="PUT">
<request>
<representation mediaType="application/xml"/>
</request>
<response>
<representation mediaType="*/*"/>
</response>
</method>
<method id="deleteTodo" name="DELETE"/>
</resource>
</resource>
</resources>
</application>
现在你能告诉我如何执行PUT、POST、DELETE命令吗?我应该在body和url中写些什么?
非常感谢
不确定你目前是如何发出请求的,尽管你可以给我的插件https://github.com/jpillora/jquery.rest尝试一下。如果您有任何问题,请在"问题"选项卡上发布问题。
相关文章:
- 使用rest客户端/javascript验证microsoftoutlook-web(owa)
- 如何在 phonegap for Android 中使用 rest Web 服务
- 如何在我的Jersey REST Web服务中使用Google OAuth2
- Chrome 扩展程序与 rest Web 服务通信
- Jquery ajax 在调用 rest Web 服务时失败
- 无法使用参数从html/javascript调用rest web服务
- AngularJS对我的REST Web服务的DELETE请求是纯文本的
- 用于REST web服务的JavaScript/jQuery客户端
- 如何创建一个将参数传递给rest web服务的控制器?
- 从JavaScript中使用XML WCF REST web服务
- 跨域$.ajax POST到REST Web服务
- 如何使用控制器调用REST web服务
- 如何使用量角器工具在REST web服务上调用DELETE方法
- 如何从返回JSON的REST web服务加载ng表中的数据
- 如何从prototypejs客户端将pojo对象作为参数传递给rest web服务
- 如何将JS属性Array发送到Jersey JAX-RS基于JSON的REST web服务
- 使用Rest客户端mozzilla消费Rest Web服务
- 如何将参数从prototypejs客户端传递到rest web服务
- 使用 Angular 2 Http 从 REST Web Service 获取数据
- 如何用ajax从Java Rest Web服务返回一个值