Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google chrome extension Simple REST Client

I am using Google chrome extension tool Simple REST Client to test my web services. How to call post method with multiple parameters. I searched in internet, there is no enough documentation for this app.

Example POST method

    @POST
     @Path("createcategory")
     @Consumes("application/x-www-form-urlencoded")
     @Produces(MediaType.APPLICATION_XML)
     public void CreateCategory(@FormParam("cname") String cname,@FormParam("cdescription") String cdescription) 
    {


     CategoriesBO category = new CategoriesBO();
     category.setCategoryName(cname);
     category.setCategoryDescription(cdescription);

     CategoriesEntityHandler handler = new CategoriesEntityHandler();
     try {
        category = handler.createCategory(category);


    } catch (Exception e) {

    }

}
like image 993
Prabhu M Avatar asked Jul 25 '12 07:07

Prabhu M


People also ask

How do I set REST Client extensions in Chrome?

Step 1: Go to the 'Chrome Web Store' then search for 'Advanced search Client' and click on 'Advanced Rest Client'. Step 2: Click on 'Add to crome' button'. Step 3: Click on the 'Add extension' button to add Advanced Rest Client on Google Chrome Extension.

What is REST Client extension?

Rest Client for Visual Studio Download this extension from the VS Marketplace or get the CI build. REST Client allows you to send HTTP request and view the response in Visual Studio directly.

How do I use REST API in Chrome?

One of the easiest ways to start testing REST APIs in Chrome is by installing a REST client such as Talend or vREST. These plugins can help you to test the REST APIs you are working on. Once you have the extension you prefer, you can start sending requests and receiving responses that help you test the REST API.


1 Answers

For "Headers", each header needs to be on a newline:

Content-Type: application/json
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36

While "Data" needs to be in json-format, so something like this:

{"login":"USERNAME","password":"PASSWORD"}

using a paramlist did not work for me.

like image 136
Quihico Sanchez van Oort Avatar answered Sep 28 '22 02:09

Quihico Sanchez van Oort