Slide 13
Slide 13 text
Parallel requests
pool = map(1:3) do i
curl = CurlEasy(url="https://postman-echo.com/post?val=$i", method=CurlHTTP.POST)
requestBody = """{"testName":"test_multiPOST","value":$i}"""
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, length(requestBody))
curl_easy_setopt(curl, CURLOPT_COPYPOSTFIELDS, requestBody)
curl_add_headers(curl, [
"Content-Type: application/json",
"Content-Length: $(length(requestBody))"
])
return curl
end
multi = CurlMulti(pool)
res = curl_execute(multi)