The Poster Firefox addon is used to test any REST applications as it used to construct the parameters and then submit the proper action (GET, POST, PUT or Delete). To add parameters, the easiest way is to choose “Body form parameters” and then add parameters as key=value pairs separated by &. For example:
first_name=Ahmed&last_name=fadel.
In the sample below, if you submitted the request as POST, then from sMash reference.groovy (the expected handler for /resources/reference), you can read those parameters as follows:
def onPostMember(){
logger.INFO {"Start"};
def first_name=zget("/request/params/first_name");
def last_name=zget("/request/params/last_name");
…....
}
Firefox Poster |
No comments:
Post a Comment