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
Hello, much like others, I cannot seem to start() a connection to the signalR server. I get back the dreaded Response Content-Type not supported: [application/json; charset=UTF-8]
I looked at the code in dartio_http_client.dart and do not understand some things, specifically with block lines 85 thru 97:
final contentTypeHeader = httpResp.headers["Content-Type"];
final isJsonContent =
contentTypeHeader.indexOf("application/json") != -1;
if (isJsonContent) {
content = await httpResp.transform(utf8.decoder).join();
} else {
content = await httpResp.transform(utf8.decoder).join();
// When using SSE and the uri has an 'id' query parameter the response is not evaluated, otherwise it is an error.
if (isStringEmpty(uri.queryParameters['id'])) {
throw ArgumentError(
"Response Content-Type not supported: $contentTypeHeader");
}
}
From what I can tell, the contentTypeHeader variable holds a 'growable list', not a simple string. Thus, when trying to find the 'indexOf("application/json")' if fails (returns -1) instead of returning 0 for the start of the 1st (0th) element in that list. In other words isJsonContent should be TRUE.
What's future interesting is that as it stands right now, with a FALSE value, the content is still decoded properly and seems fine. However because there is no 'id' query param in the uri, the code throws the ArgumentError that several of us have hit.
So, what is the solution to this? Is this something that can be fixed?
Thank you,
-David
The text was updated successfully, but these errors were encountered:
The comment by the Soernt, and the comment after his, seems to imply that this plug in will ONLY work with .Net Core. I am using a .Net frameworks/OWIN site. Does that really mean me (and others like me) cannot use this plug in? In re-reading the README on this repo, it does in fact 'only' say .Net Core.
Thank you for the verification Sörnt. I am now in the process of re-writing (porting) my .net framework web api site to .net core 2.2... hopefully it will not be too much effort and your plug in will then work.
Hello, much like others, I cannot seem to start() a connection to the signalR server. I get back the dreaded Response Content-Type not supported: [application/json; charset=UTF-8]
I looked at the code in dartio_http_client.dart and do not understand some things, specifically with block lines 85 thru 97:
From what I can tell, the contentTypeHeader variable holds a 'growable list', not a simple string. Thus, when trying to find the 'indexOf("application/json")' if fails (returns -1) instead of returning 0 for the start of the 1st (0th) element in that list. In other words isJsonContent should be TRUE.
What's future interesting is that as it stands right now, with a FALSE value, the content is still decoded properly and seems fine. However because there is no 'id' query param in the uri, the code throws the ArgumentError that several of us have hit.
So, what is the solution to this? Is this something that can be fixed?
Thank you,
-David
The text was updated successfully, but these errors were encountered: