Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
966 views
in Technique[技术] by (71.8m points)

automation - Easiest way to automate https requests

I need to automate the submission of a lot of requests to a cloud-based database interface (Intelex). There isn't any way to submit certain actions in bulk, but all that is necessary to submit an individual request is for an authenticated user to attempt to open the web link. So, to restore a record with a given GUID all I need to do is open the page "https://.../restore/[GUID]". The webpage will load and display the now-restored record, but I don't actually need it to even finish loading - simply requesting the page is enough for the server to perform the action. I expect the server will either kick me out or drop some of the requests if I send them too quickly, but it has no issues with processing them as fast as I can navigate and open links in a new browser tab (about 1 per second).

What is the easiest way to submit these requests for a few thousand web addresses?

question from:https://stackoverflow.com/questions/65907322/easiest-way-to-automate-https-requests

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I can see couple of ways here. Each are pretty much easy.

  1. Store your variable part of URL in a file. Then use the tool like CURL and loop through file content calling CURL with the URL you have built on each iteration. If you're using Linux you can do something like Looping through the content of a file in Bash, for Windows check this post: How do you loop through each line in a text file using a windows batch file?

  2. Use JMeter tool (jMeter loop through all values in CSV). This will even aloww you to parallelize your queries.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...