Describe the bug
In v2.2.0 we had following code of custom transform
public override async Task ApplyRequestTransform(RequestTransformContext requestContext)
{
requestContext.ProxyRequest.Content = new StringContent(body, Encoding.UTF8, contentType);
}
After upgrade to v2.3.0, we can't use this code anymore due to new exception that is being thrown (See #2722).
I'm trying following logic to make it work, but no luck. Downstream service receives empty body.
var bodyBytes = Encoding.UTF8.GetBytes(body);
requestContext.HttpContext.Request.Body = new MemoryStream(bodyBytes);
requestContext.HttpContext.Request.Headers.ContentLength = bodyBytes.Length;
requestContext.ProxyRequest.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue(contentType);
I am not able to find a workaround for this :(
To Reproduce
Just transform GET request to POST with body
- Make a request transform that converts
GET request to POST setting new body.
- Downstream service will receive empty body.
Further technical details
Describe the bug
In v2.2.0 we had following code of custom transform
After upgrade to v2.3.0, we can't use this code anymore due to new exception that is being thrown (See #2722).
I'm trying following logic to make it work, but no luck. Downstream service receives empty body.
I am not able to find a workaround for this :(
To Reproduce
Just transform
GETrequest toPOSTwith bodyGETrequest toPOSTsetting new body.Further technical details