I'm testing on Windows, trying to simulate POST requests (with different form variables) for load testing. I have tried all kinds of load testing software but failed to get it working.
For GET requests, I know I can just put parameters behind the url
But how do I simulate a POST request?
F3 Setup Guide (199 KB) Expanded wiring diagrams for basic F3 setup scheme. Complete set of codes for customizing the IR software on your remote. MPGUI Control System Integration Guide (307.5 KB). This version contains a completely updated GUI with support for Pandora, similar to the ReQuest HDGUI. If you don't wish to change.
I have a chrome REST Client but I do not know what to put in the headers and data.
Here's what I've tried so far:
Shog9♦132k3131 gold badges210210 silver badges228228 bronze badges
user1663380user166338042533 gold badges1212 silver badges2121 bronze badges
5 Answers
It would be helpful if you provided more information - e.g. what OS your using, what you want to accomplish, etc. But, generally speaking cURL is a very powerful command-line tool I frequently use (in linux) for imitating HTML requests:
For example:
OR, for a RESTful API:
You can check out more information here->http://curl.haxx.se/
EDITs:
OK. So basically you're looking to stress test your REST server? Then cURL really isn't helpful unless you want to write your own load-testing program, even then sockets would be the way to go. I would suggest you check out Gatling. The Gatling documentation explains how to set up the tool, and from there your can run all kinds of GET, POST, PUT and DELETE requests.
Unfortunately, short of writing your own program - i.e. spawning a whole bunch of threads and inundating your REST server with different types of requests - you really have to rely on a stress/load-testing toolkit. Just using a REST client to send requests isn't going to put much stress on your server.
More EDITs
So in order to simulate a post request on a socket, you basically have to build the initial socket connection with the server. I am not a C# guy, so I can't tell you exactly how to do that; I'm sure there are 1001 C# socket tutorials on the web. With most RESTful APIs you usually need to provide a URI to tell the server what to do. For example, let's say your API manages a library, and you are using a POST request to tell the server to update information about a book with an id of '34'. Your URI might be
Therefore, you should open a connection to localhost on port 80 (or 8080, or whatever port your server is on), and pass along an HTML request header. Going with the library example above, your request header might look as follows:
From here, the server should shoot back a response header, followed by whatever the API is programed to tell the client - usually something to say the POST succeeded or failed. To stress test your API, you should essentially do this over and over again by creating a threaded process.
Also, if you are posting JSON data, you will have to alter your header and content accordingly. Frankly, if you are looking to do this quick and clean, I would suggest using python (or perl) which has several libraries for creating POST, PUT, GET and DELETE request, as well as POSTing and PUTing JSON data. Otherwise, you might end up doing more programming than stress testing. Hope this helps!
CRKCRK
Postman is the best application to test your APIs !
You can import or export your routes and let him remember all your body requests ! :)
LunaLuna
Simple way is to use
curl
from command-line, for example:or here is example how to send raw POST request using Bash shell (JSON request):
kenorbkenorb76k3333 gold badges434434 silver badges451451 bronze badges
This should help if you need a publicly exposed website but you're on a dev pc. Also to answer (I can't comment yet): 'How do I post to an internal only running development server with this? – stryba '
NGROK creates a secure public URL to a local webserver on your development machine (Permanent URLs available for a fee, temporary for free).
1) Run ngrok.exe to open command line (on desktop)
2) Type ngrok.exe http 80 to start a tunnel,
3) test by browsing to the displayed web address which will forward and display the local default 80 page on your dev pc
1) Run ngrok.exe to open command line (on desktop)
2) Type ngrok.exe http 80 to start a tunnel,
3) test by browsing to the displayed web address which will forward and display the local default 80 page on your dev pc
Then use some of the tools recommended above to POST to your ngrok site ('https://xxxxxx.ngrok.io') to test your local code.
user6923055user6923055
Dont forget to add user agent since some server will block request if there's no server agent..(you would get Forbidden resource response) example :
navoteranavotera