How to send query parameters and body data in jMeter post request - node.js

I am new to Jmeter please help me in this, i try to do performance test of my nodejs application.And i have one api, for this i have to pass parameters as well as post from .csv file but i am not able to achieve so give your valuable input

Put your parameters to "Path" input field
Put your request body to "Body Data" input field
You might also need to add a HTTP Header Manager and configure it to send Content-Type header with the value of application/json. See REST API Testing - How to Do it Right for more details.

Related

POST body for Google Cloud Build - Webhook Triggers

The Google Cloud Build - Webhook Trigger create trigger documentation shows the proper URL to POST to invoke the build trigger. However the documentation does not describe the POST body, which seems to be required. I have successfully triggered the cloud build webhooks using content-type: application/json header with a POST body of {}, but it would be nice to know:
What is the POST body supposed to be?
Are we able to pass substitution variables in the POST body?
The Google Cloud Build - REST API documentation provides some additional hints that a HttpBody payload is accepted, but no additional information past that as for as I can tell.
The body is what you want! In fact, in your trigger you customize your substitution variable like this (from the documentation)
--subtitutions=\
_SUB_ONE='$(body.message.test)', _SUB_TWO='$(body.message.output)'
So, your body need to be like that
{
"message": {
"test": "test value",
"ourput": "my output"
}
}
The data are automatically extracted from your body content. So you can add more substitutions or change the format of your JSON and thus of your substitutions value.

How to trigger a workflow in Azure Logic App along with parameters taken by trigger as input?

https://learn.microsoft.com/en-us/rest/api/logic/workflowtriggers/run
The above REST API has no option to pass trigger parameters in body, even though it is a "POST" call.
Am I missing something here?
When you want your HTTP endpoint URL to accept parameters, customize your trigger's relative path.
First on your Request trigger, choose Show advanced options. Under Relative path, specify the relative path for the parameter that your URL should accept, for example, name/{name}.
To use the parameter, add a Response action to your logic app.
In your response's Body, include the token for the parameter that you specified in your trigger's relative path.For example, to return Hello {name}, update your response's Body with Hello {name}.
Then you could add it into Body when you post a call.
For more details, you could refer to this article.
Update:
The REST API mentioned above in question does accept the input in body. Its only that the "try it" feature in API documentation was not showing it.

How to Use HTTP Receive GET Message in Orchestration?

I have set up a HTTP Receive (req-response) adapter and the message appears to be getting to the message box. When I create an orchestration using a direct bound logical port, I am getting the message but everything I have tried to read the message body has failed (using passthrough pipeline, XML pipeline with allow unrecognized files = true) but I get exceptions any time I try to use the incoming message (message assignments, sending the message to a custom module to try to read the part(s)).
Rather than go into details on exceptions, can anyone point to instructions on what the proper way to access/use the body of the HTTP Get messages within an orchestration? To explain what I am trying to do, I want to take the query string (body) and send it verbatim to another orchestration for processing, so I simply want to extract the body (query string) from the message.
For a GET request without a body you need to use the WCF-WebHttp adapter rather than the deprecated BTSHTTPReceive.dll
With the WCF-WebHttp you can use the Variable Mapping to populate message context properties with the URI parameters.
So the answer was to NOT use the HTTP adapter for GET requests. I did not realize the HTTP adapter has effectively been deprecated. For basic GET requests I had to switch to the WCF-WebHTTP adapter and make sure to include the property in the property schema and then make sure to set the schema in the variable mapping as the property schema, not the message type schema of the incoming message. I wish the Microsoft documentation was more clear that the HTTP adapter cannot be used for very basic GET requests in which a body is not provided in the request.

azure logic app & http step response

I have 2 HTTP actions, one after another in a logic app, how do I read the response from a previous HTTP action in the second HTTP action?
First HTTP call (REST) returns a response in JSON format -
{
"authResult": {
"isPasswordExpired": true,
"authToken": "cxxcxcxc",
"message": "Login Successful"
}
}
I want to send authtoken from the result in second http action as authorization header.
As Derke Li mentioned that we could use exression or Parse Json to do that. I also do a demo about how to use the Parse JSON action.
1.Add the Parse Json action after the first Http action
2.Add the parse content and click on the button "Use sample payload to generate schema" and that will pop a new window. Paste in your "authResult" json. As seen in the below image.
3.Then we could pick the token from the dynamic content.
4.We could check the result.
There are two ways you can do this.
Use expression to directly reference the property. #body('NameOfFirstHTTPAction')?['authResult']?'[authToken]
Add a "Parse JSON" action in between the two HTTP action, and provide a sample response of the first HTTP action to generate a schema. Then, in the second HTTP action, you will see authToken as a token from the dynamic content picker for you to reference.

how to send post data on the chrome.downloads.download method?

Im trying to use the chrome.downloads.download method and i need to send post data to the server, i use options.body="?keyName=value" on the download options but it doesn't work. Maybe someone knows better the api, the documentation is not very explicit about this subject.
'cause Chrome doesn't set request content-type for you, you can verify this through this script:
<?php
header('Content-Type: text/plain; charset="utf-8"');
var_dump($_SERVER['REQUEST_METHOD']);
var_dump($_GET);
var_dump($_POST);
var_dump($_SERVER['CONTENT_TYPE']);
var_dump(file_get_contents('php://input')); // $HTTP_RAW_POST_DATA
?>
So, you should use parse_str($HTTP_RAW_POST_DATA, $post_params) to get the values of the parameters. PHP won't parse the post body if content-type is not properly set. (application/x-www-form-urlencoded, application/www-url-encoded, etc.)

Resources