Firefox HTTP resource test post parameter - firefox

I'm using HTTP Resource Test on Firefox and want to simulate a POST request. However I didn't find where to write the post parameters. There are only URI, Representation and Headers, is there any way that I can pass with some post parameter? (In Json format?)

The payload of the post should go in the body of the request. It's shown here:
https://addons.cdn.mozilla.net/img/uploads/previews/full/54/54035.png?modified=1297743921
For example, if you were posting a JSON document you could just paste the JSON in the "Body" text area.

The payload of the post should go in 'Client Request' / 'Representation'.
It's shown on this screenshot.
As an aside, this answer describes an excellent test server to use as a sanity-check.

Related

POST request elasticsearch with no body

I am not allowed request bodies. Post requests have to be done using just the url
Is it possible for me to use elasticsearch in this scenario?
I'm looking for something along the lines of
POST host/doublepull/run?data='{"dsl":0,"fnl":0.75}'
POST host/doublepull/run?dsl=0&fnl=0.75
POST host/doublepull/run?'{"dsl":0,"fnl":0.75}'
but nothing appears to fit (always get IllegalArgumentException). Could not find any documentation on trying to use POST for it in this way

Send Form data and Query string in one POST request in Jmeter

I need to send POST request through jmeter. I have checked the requests workflow through browser dev. tools. In my Post request I need to send form data and one string Query. Question is next - if i will add my string Query to URL will it work fine?
Example : somesite.com/something?refURL=someRef
If it is a POST request, usually any form data will be sent in the request body. Not like a query string in the GET request. But the format is same.
refURL=someRef add this in the parameters section.
Check here for more info.
https://www.w3.org/TR/html401/interact/forms.html#h-17.13
Why not? Query string and request body are different beasts and they are processed differently on server side.
Instead of asking this kind of questions, why don't you just record your test using JMeter's proxy server?
References:
URI Syntax - Query Component
HTTP Method Definitions - POST
Yes it will.
You can even use variables like:
/some/path?refURL=${someCalculatedRefUrl}

Posting JSON as a request parameter not sending it raw

I'm sending POST request on Jmeter with one of the parameters with json format. But JMeter is not sending it as a raw as you can see below. It's encoding the json and requesting with % and numbers... **msg** should be sending raw json.
I tried various options with encoding but none is working. How can I send json as a raw as a request parameter?
POST data:
trans_code=KycPartnerSender&version=1.0&pkg_id=1234123&timestamp=123123&**msg**=%7B%22sId%22%3A%7B%22weChatId%22%3A%22jnaS001%22%7D%2C%22sInfo%22%3A%7B%22firstName%22%3A%22jnaSender001%22%2C%22middleName%22%3A%22%22%2C%22lastName%22%3A%22QA%22%2C%22dob%22%3A%221958-01-31%22%2C%22email%22%3A%22001%40ZB.CA%22%2C%22taxId%22%3A%22467456789%22%2C%22mobilePhone%22%3A%224161231234%22%2C%22workPhone%22%3A%224161231234%22%2C%22citizenCountryCode%22%3A%22CA%22%2C%22residenceCountryCode%22%3A%22CA%22%7D%2C%22sAddress%22%3A%7B%22line1%22%3A%22123+Yonge+Street%22%2C%22line2%22%3A%22Suite+1902%22%2C%22city%22%3A%22Toronto%22%2C%22countryRegionCode%22%3A%22ON%22%2C%22postalCode%22%3A%22M2M2M2%22%2C%22countryCode%22%3A%22CA%22%7D%2C%22sFundingSource%22%3A%7B%22accountNumber%22%3A%22123456789%22%2C%22accountHolderName%22%3A%22JNA+SENDER%22%2C%22routingNumber%22%3A%2200402652%22%7D%2C%22rId%22%3A%7B%22weChatId%22%3A%22jnaR001%22%7D%2C%22rInfo%22%3A%7B%22firstName%22%3A%22jnaReceiver%22%2C%22middleName%22%3A%22X%22%2C%22lastName%22%3A%22QA%22%2C%22dob%22%3A%221970-10-31%22%2C%22email%22%3A%22002%40ZB.CA%22%2C%22taxId%22%3A%22789456123%22%2C%22mobilePhone%22%3A%224161231234%22%2C%22workPhone%22%3A%224161231234%22%2C%22citizenCountryCode%22%3A%22CA%22%2C%22residenceCountryCode%22%3A%22CA%22%2C%22employmentStatus%22%3A%22Full+Time%22%2C%22occupationCode%22%3A%22102%22%2C%22industryCode%22%3A%22101%22%7D%2C%22rAddress%22%3A%7B%22line1%22%3A%22123+Bloor%22%2C%22line2%22%3A%22Suite+1900%22%2C%22city%22%3A%22Toronto%22%2C%22countryRegionCode%22%3A%22ON%22%2C%22postalCode%22%3A%22M2M2M2%22%2C%22countryCode%22%3A%22CA%22%7D%2C%22rFundingSource%22%3A%7B%22accountNumber%22%3A%22987654321%22%2C%22accountHolderName%22%3A%22JNA+RECEIVER%22%2C%22routingNumber%22%3A%2200402652%22%7D%7D
Instead of using Parameters table, select the Raw Body tab and just put your json body.
Of course it only works with Post method (not Get) so it should be ok for you.

How to prepare POST data from a previous HTTP response?

I've used Fiddler to capture these HTTP calls. Here's the problem:
I have a HTTP-POST data that looks like below:
Notice how it has many 'employeeIds' and also 'shiftSumIds'.
Now, these Ids are from a previous HTTP response that looks like below:
Is there an easy way to extract those Ids and prepare the POST data? Thanks in advance.
--Ishti
Short answer is JSON Path Extractor available via JMeter Plugins which is designed for getting "interesting" values from JSON data. See Using the XPath Extractor in JMeter guide (look for "Parsing JSON" chapter) for installation instructions and some form of JSON Path language reference.
If it is not enough and you will need some assistance in constructing JSON Path query and building HTTP Request from it - please include text version of response and request using i.e. http://paste.org service as reading large amount of text from small screenshot isn't very handy and chance of getting the answer is minimal

Overwriting HTTP response headers

Is there a way to overwrite the http response headers returned in Jmeter? I'm testing a web service that returns JSON and when an invalid request is sent, the JSON response returned doesn't contain application/json (or any for that matter) in the response header. If I save the response to a file, I see the actual JSON returned, but looking at the response in a Results tree doesn't show a response. Unless there is a way to load the response from file and parse the error message from the file, I'm hoping to somehow overwrite the HTTP response header and force jmeter to treat the response as JSON.
Any suggestions are welcome!
Using a beanshell post processor, you can write some script that would force the value for the header, or write out to a file.
You can also add a listener that would write the results to file for you. Granted - this is less convenient for debugging then Tree View.
As it turns out JMeter does not support response header overloading. While the response isn't displayed in the Results tree, it is actually available to other assertions. I was able to still provide assertions to validate responses even though the response was missing from the GUI.

Resources