Add response body and headers processing
In the `InvokeRecActionCommandHandler` class, added code to read the response content as a string and store it in a `body` variable. Also, converted response headers into a dictionary and stored them in a `header` variable. These changes facilitate further processing of the response content and headers.
This commit is contained in:
parent
904448ca45
commit
0837bca6cb
@ -37,6 +37,9 @@ public class InvokeRecActionCommandHandler(ISender sender) : IRequestHandler<Inv
|
|||||||
"TRACE" => await http.SendAsync(new HttpRequestMessage(HttpMethod.Trace, action.EndpointUri), cancel),
|
"TRACE" => await http.SendAsync(new HttpRequestMessage(HttpMethod.Trace, action.EndpointUri), cancel),
|
||||||
_ => throw new BadRequestException($"The REST type {action.RestType} is not supported.")
|
_ => throw new BadRequestException($"The REST type {action.RestType} is not supported.")
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var body = await response.Content.ReadAsStringAsync(cancel);
|
||||||
|
var header = response.Headers.ToDictionary();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user