You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
‘Body’ is taking the property string literally "@{dialog.httpbody}". It seems that Body requires a JObject. In turn, Json is throwing an exception
Example:
new Microsoft.Bot.Builder.Dialogs.Adaptive.Actions.HttpRequest()
{
// Set response from the http request to turn.httpResponse property in memory.
ResultProperty = "dialog.httpResponse",
Url = apiUrl,
Method = HttpRequest.HttpMethod.POST,
Body = "@{dialog.httpbody}",
ResponseType = HttpRequest.ResponseTypes.None
},
$exception {System.InvalidOperationException: The parent is missing.
at Newtonsoft.Json.Linq.JToken.Replace(JToken value)
at Microsoft.Bot.Builder.Dialogs.Adaptive.Actions.HttpRequest.ReplaceJTokenRecursively(DialogContext dc, JToken token)
at Microsoft.Bot.Builder.Dialogs.Adaptive.Actions.HttpRequest.BeginDialogAsync(DialogContext dc, Object options, CancellationToken cancellationToken)
The text was updated successfully, but these errors were encountered:
I debugged this and the core issue seems to be twofold.
Issue #1: we should consider adding headers without validation TryAddWithoutValidation so things like adding content-type does not blow up (it does with a .Add())
// Set headersif(instanceHeaders!=null){foreach(varunitininstanceHeaders){client.DefaultRequestHeaders.TryAddWithoutValidation(awaitnewTextTemplate(unit.Key).BindToData(dc.Context,dc.GetState()).ConfigureAwait(false),awaitnewTextTemplate(unit.Value).BindToData(dc.Context,dc.GetState()).ConfigureAwait(false));}}
Issue #2: Data binding within JArray blows up in ReplaceJTokenRecursively
‘Body’ is taking the property string literally "@{dialog.httpbody}". It seems that Body requires a JObject. In turn, Json is throwing an exception
Example:
$exception {System.InvalidOperationException: The parent is missing.
at Newtonsoft.Json.Linq.JToken.Replace(JToken value)
at Microsoft.Bot.Builder.Dialogs.Adaptive.Actions.HttpRequest.ReplaceJTokenRecursively(DialogContext dc, JToken token)
at Microsoft.Bot.Builder.Dialogs.Adaptive.Actions.HttpRequest.BeginDialogAsync(DialogContext dc, Object options, CancellationToken cancellationToken)
The text was updated successfully, but these errors were encountered: