How to keep an Array in Jmeter parameters request field - arrays

i need to add this array in the parameters in Jmeter inorder to complete the POST request. And i am getting a 400 error.
This is the array, which needs to have a POST request:
conditions :[{accountStatus: 'UNVERIFIED'}, {accountStatus: 'INVITED'}]

Just add a Parameter with blank name and put your JSON array as a value like:
You can use View Results Tree listener to inspect request and response details:
Also make sure you add HTTP Header Manager to send at least Content-Type header with the value of application/json

Add the JSON data in Body Data tab instead of parameters tab.

Another solution:
Add to the list of variables
Name - "someArray[0]"
Variable - "someText"
See more about Request options here

Related

How to apply multiple filters to a query in url for gmail api

I am using HTTP requests via an Oracle database to extract data from Gmail APIs.
In Oracle, you apply all filters to either the URL of the request or its body.
This is working fine for simple requests such as the URL below to request list of unread messages in inbox for user:
https://gmail.googleapis.com/gmail/v1/users/me/messages?maxResults=500&q=is:unread&labelIds=INBOX
If I try to add more than one filter to the URL (or LabelIds) like in the URL below, I get an error response from the request:
https://gmail.googleapis.com/gmail/v1/users/me/messages?maxResults=500&q=is:unread newer_than:2d&labelIds=INBOX
I have tried multiple iterations for "q=" part like using double quotes, but anything I try outside of 1 filter returns an error response.
The documentation at https://developers.google.com/gmail/api/guides/filtering give this filtering example, but that clearly doesn't work for me:
https://www.googleapis.com/gmail/v1/users/me/messages?q=in:sent after:2014/01/01 before:2014/02/01
I tried removing the "is:unread" filter and adding it as a label, but I get a similar issue when trying to use multiple labelIds in the URL request. Using just labelIds=INBOX works fine, but using labelIds=INBOX,UNREAD or various iterations of that with quotes and square brackets all return error responses.
How do I use multiple filters (and/or multiple labelIds) in the URL of a request?
Thanks,
Dick
It looks like the problem is with the space between each filter in the q section.
If I add %20 for the space, it works.
For example, "https://gmail.googleapis.com/gmail/v1/users/me/messages?maxResults=500&q=is:unread newer_than:2d&labelIds=INBOX" will not work, but "https://gmail.googleapis.com/gmail/v1/users/me/messages?maxResults=500&q=is:unread%20newer_than:2d&labelIds=INBOX" will work.

how to split json response as MultipartForm data with a given boundary value in Spring REST

My Spring REST service responds with a huge json Response,
i wanted to split that json with Multipart/form-data with some boundary value how could i do that,
this is what i tried
headers.add("Content-Type", "multipart/form-data;
boundary='SOMEBOUNDRY_VALUE'");
But i don't know how to split the response object values, can i just put the phrase "SOMEBOUNDAY_VALUE" ? between the large attribute values of response object ?
any help would be a great help, i'm using Spring Rest
Here is the Response i get from SOAP
Response Header from SOAP
response is not full and truncated though
I solved this by manually adding delimiter after every json value of each attribute, if the attribute is more then 2mb in size then i split the attribute to 2MB and separated by adding delimiter to it,
the reason why we needed multipart/form-data in our service response is our security layer won't accept more then 2MB attribute value while processing it, so we split the large attribute in to arrayList and added delimiter at end of each array value, which can be re-phrased at client side which served the purpose
headers.add("Content-Type", "multipart/form-data;
boundary='SOMEBOUNDRY_VALUE'");
still be there to indicate the response type is mulltipart/form-data along with the above specified delimiter logic

Postman dictionary for multiple variables.

On a POST request via Postman I pass the dealer id in the body of the request with the bearer token and run my test collection. Is there a way to set it as a variable and use a dealer id dictionary to loop through all of the values?
You can use csv as a source of those. See THIS blog post.

Restangular Delete with body data

Below is my restangular delete request where i intend to pass an array of ids to delete based on user selection
var deleteIds = [1,5,10]
Restangular.all('url').customDELETE(deleteIds);
I want this deleteIds to be passed in body params. How can i send the array as body so tat i could see the request payload.
Actually I also needed to use the delete http method with data passed in the body, and I found that Restangular supports a customOperation
documentation:
https://github.com/mgonto/restangular#custom-methods
customOperation(operation, path, [params, headers, elem]): This does a custom operation to the path that we specify. This method is actually used from all the others in this subsection. Operation can be one of: get, post, put, remove, head, options, patch, trace
example:
Restangular.all('some/path/123')
.customOperation('remove', '',{'content-type': 'application/json'},[1,5,10])
Depending on the backend technology you use, the body might be ignored for DELETE requests. See this question for more info.
I would suggest you to pass the id's as a part of the url.

Thread get - just metadata

I am doing full sync this way: list of /threads and then a request to get each of the thread like /threads/{id}. However this returns me every message together with it's body data -> and I just want to fetch the metadata of the messages. I can see that in get 'messages/{id}' you can specify format but not in get threads/{id}
Threads.get() now supports format=METADATA and with that you can use the new "metadataIncludeHeaders" to further limit the headers list to a select few. This is much more efficient than using "fields" as it only fetches what is necessary from the backend rather than filtering it later on:
https://developers.google.com/gmail/api/v1/reference/users/threads/get
I assume that by metadata you mean the headers (no body). You can use the fields parameter to get just that (messages/payload/headers):
https://www.googleapis.com/gmail/v1/users/me/threads/{thread-id}?fields=messages%2Fpayload%2Fheaders&key={YOUR_API_KEY}

Resources