简体   繁体   中英

Different concurrent requests to REST API

I want to know how I can issue multiple, different cURL requests concurrently to a RESTful API, to test my application. I'm using a Maru RESTful API for Elixir, and my requests only differ in the GET arguments. My cURL requests look something like:

curl -X GET http://localhost:8880/path -G -d "data1=abc&data2=123&..."

where the values of data1 , data2 etc. differ. I would prefer some sort of a tool like ab , the Apache HTTP server benchmarking tool, but ab only allows concurrent requests of the same kind. I am trying to test my application for concurrent, differing responses to the different, concurrently issued cURL requests.

You will need to make your cURL requests asynchronous , so they can run in the same time and when they are finished, a callback function is called. However, this will not necessarily solve your problem, since there is a chance that the remote API is using something like IIS, serving requests sequentially.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM