Sobes.tech
Junior — Middle

Does a request to an external API occur if its cancellation is planned?

sobes.tech AI

Answer from AI

If it is about canceling a request via CancellationToken in C#, then the request to the external API is usually already sent when the method, such as HttpClient.SendAsync, is called. Cancellation via CancellationToken can interrupt waiting for the response and free resources, but the network request may have already been sent. That is, cancellation does not prevent the request from being sent, but cancels further processing and response handling.