Venkat Matta

it's all about the Performance Testing

REST

Representational State Transfer (REST) uses the HTTP request method, and the most popular  are GET, POST, PUT and DELETE. Responses to these requests return status codes indicating success or failure as well as any applicable headers, and JSON representing the affected fields (or nothing) in the message body. The following sections describe how you can easily write a JMeter script with one of these methods.

GET REQUEST METHOD

1. Add an HTTP Request to your Thread Group.

2. Fill in the Server Name or IP, path, and choose GET method.

For example, we use maps.googleapis.com as Server Name and ‘/api/geocode/xml’ as path

3. If your API request contain query parameters, you may specify it in path (for example, ‘address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false’) or in Parameters area:

Name :  address Value :1600+Amphitheatre+Parkway,+Mountain+View,+CA

Like this we need to add all the parameters and refer below snapshot

Jmeter_Rest

4. Add the Listener -> View results results in Tree and execute the scenario

Based on your requirement , we need to add the number of user in the test plan.

POST REQUEST METHOD

In POST requests, you can fill in both the body and the headers. You can also specify query parameters in path. The HTTP headers, which contain metadata, are tightly defined by the HTTP spec. They can only contain plain text and must be formatted in a certain manner. To specify headers, you’ll need the HTTP Header Manager, and the most common headers are Content-Type and Accept.

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Information

This entry was posted on August 25, 2020 by in Uncategorized.

Navigation

%d bloggers like this: