2013-02-13 60 views
-1

我能夠成功執行GET請求的服務,現在我想知道如何執行POST休息web服務,通​​過REST客戶端PUT,DELETE命令消費使用REST客戶mozzilla

我執行的期權指令,我得到這個結果

<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 commant?我應該寫在身體和網址?

非常感謝

回答