
Hi,
I built a custom connector with a `NewLead` trigger and a `CreateLead` action. Both have an input value called `channel_id`. The `channel_id` should be chosen from a dynamic dropdown that makes a GET request via the `GetChannels` action.
Everything is set up, and the `GetChannels` action is fetching the list of channels correctly when I test it in isolation, but when I am testing the dynamic dropdown for the `channel_id` input, the `GetChannels` request is failing, and shows this error message in the dropdown:
The dynamic invocation request failed with error: Unexpected error occurred when calling the ApiHubsRuntime API: 'System.InvalidOperationException: Misused header name. Make sure request headers are used with HttpRequestMessage, response headers with HttpResponseMessage, and content headers with HttpContent objects.
at System.Net.Http.Headers.HttpHeaders.CheckHeaderName(String name)
at System.Net.Http.Headers.HttpHeaders.Add(String name, String value)
at Microsoft.Azure.ProcessSimple.Data.DataProviders.HttpClientDataProvider.<>c__DisplayClass49_1`2.<<CallService>b__0>d.MoveNext() in C:\__w\1\s\src\processsimple\Roles\ProcessSimple.Data.Shared\DataProviders\Services\HttpClientDataProvider.cs:line 562
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.WindowsAzure.ResourceStack.Common.Algorithms.AsyncRetry.<Retry>d__3`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.Azure.ProcessSimple.Data.DataProviders.HttpClientDataProvider.<CallService>d__49`2.MoveNext() in C:\__w\1\s\src\processsimple\Roles\ProcessSimple.Data.Shared\DataProviders\Services\HttpClientDataProvider.cs:line 509'.
What is this error message referring to?
My request headers are these:
{
"Authorization": "Bearer ****",
"Accept": "application/json",
"OData-MaxVersion": 4,
"OData-Version": 4,
"If-None-Match": "null",
"Content-Type": "text/plain"
}
My response headers are these:
{
"cache-control": "private, no-cache, no-store, must-revalidate",
"content-encoding": "gzip",
"content-type": "application/json; charset=UTF-8",
"date": "Tue, 16 Jul 2024 19:51:21 GMT",
"expires": "Sat, 19 Jul 2014 19:51:21 GMT",
"pragma": "no-cache",
"strict-transport-security": "max-age=31536000; includeSubDomains;",
"x-app": "hit",
"x-content-type-options": "nosniff",
"x-frame-options": "deny",
"x-ms-apihub-cached-response": "true",
"x-ms-apihub-obo": "false",
"x-xss-protection": "1; mode=block"
}
Content-Type Header: You are setting Content-Type to text/plain. This header should be set to application/json since you are expecting a JSON response and making a GET request that might not have a body.
If I've been helpful, please mark my answer as Resolved/Answered and give it a thumbs up. This will help others too.