I have a function that uploads a file with a TIdHTTP Post request. It uses a TIdMultiPartFormDataStream for the file so is using the function
function TIdCustomHTTP.Post(AURL: string; ASource: TIdMultiPartFormDataStream): string;
This part works correctly, but I'd like to slow the rate it is sending so it uses less bandwidth.
Is there a way to loop a writebytes call or something so I could stick some sleeps in the middle and slow it down? I don't care about the response from the request.
Indy has a TIdInterceptThrottler
component for this very purpose. You can assign it to the TIdHTTP.Intercept
property, and then set the TIdInterceptThrottler.SendBitsPerSec
property as needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With