My incoming payload is
{ "data":"testdata"}
along with a header X-Type = headerType, I want to map the header into the payload before sending it to the backend system
I want to convert the payload as below
{"data":"testdata","type":"headerType"}
I tried set body but no luck, can some one help
<set-body>@{
var requestBody = context.Request.Body.As<JObject>(preserveContent:
true);
requestBody ["type"] = context.Request.Headers.GetValueOrDefault("X-Type","");
return requestBody.ToString();
}</set-body>