2

I've several files containg POST body requests.

I'd like to send those requests in parallel.

Related curl command is like:

curl -s -X POST $FHIR_SERVER/ -H "Content-Type: application/fhir+json" --data "@patient-bundle-01.json"

Request bodies are files like patient-bundle-xx, where xx is a number. Currently, I'd like to send up to 1500 requests using this incremental pattern.

  1. How could I send above requests using incremental pattern?
  2. How could I do this in parallel?

1 Answer 1

1

With GNU Parallel:

doit() {
  bundle="$1"
  curl -s -X POST $FHIR_SERVER/ -H "Content-Type: application/fhir+json" --data "@patient-bundle-$bundle.json"
}
export -f doit
export FHIR_SERVER
seq -w 99 | parallel -j77 doit

Adjust -j77 if you do not want 77 jobs in parallel.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.