Skip to main content

Practice ยท 2 of 4

The POST That Carries Its Headers

CHALLENGE
Difficulty: intermediate+25 XP

Implement PostJsonAsync: POST the given JSON body to the path with Content-Type application/json and header X-Trace: <traceId>. The stub records the request โ€” verify method, path, content-type header, and the X-Trace header all arrived. ``csharp static Task PostJsonAsync(HttpClient http, string path, string json, string traceId, CancellationToken ct = default); ``

Back to lesson: Practice: HTTP Practice: Handlers, Outcomes, Retries