-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using HTTP client to send requests, it is found that request HTTP header is all lowercase. #16665
Comments
@fly512 Which HttpClient are you using - |
Also field headers are case insensitive, per my understanding of http |
Looks like a dup of dart-lang/sdk#25120 |
I read the IO Library of dart |
@fly512 it's intentional. The server you are using is not HTTP compliant. |
@zoechi I think so, but we can't control the header sent by HTTP, which sounds strange. Or do I need to use socket to handle it on my own? But it may take a long time, and it may not be reliable. |
You are not supposed to influence casing of headers because according to the standard it needs to be ignored. |
I also have the same problem and I tried contacting the support, but they didn't want change the headers, so now I have to make it work somehow. Can I modify Flutter source files so the headers are case-sensitive, or write a plugin for that, or create a plugin that uses the native (Java/Swift) HTTP requests, because I know that Android's HttpsURLConnection uses case-sensitive headers, not sure about Swift though. |
@boapps They shouldn't need to change their headers. Sure, you can create a Flutter plugin that uses native Android or iOS implementations. |
@zoechi Thanks for the reply sorry for bad wording, I contacted them and I actually asked them to make their headers case-sensitive and told them that their API is not HTTP compliant, nothing changed and got a template response (to be fair, I am creating an unofficial client app for the official Hungarian-school-evaluation-management-system thing and their API was not documented anywhere, I discovered it with wireshark). |
I'm going to close this because I there is nothing the Flutter team can do. |
Hello @boapps , Did you find a solution for this problem? I'm in the same problem as you described here. |
@catalin260 I wrote a plugin that could do simple http push and get requests. Nothing special, it just passes some headers and a URL to the Android HttpURLConnection then returns the result text. It only works for Android. But I don't use it, because I found a workaround the initial problem. |
What? the bug is closed? So what can we do to keep the header? |
@boapps whats is the workaround? |
Creating an API Client using HTTPClient with the following request headers:
And the server (nginx/1.15.8) is returning a 400 error:
Using the same headers in android with the following request headers:
And the same server is returning a 200 response, so I'm really looking forward to integrating the change by @zichangg : dart-lang/sdk#39657 (comment) See Dart Issue Comment on the same issue here dart-lang/sdk#33501 (comment) |
do you have find an solution ? |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Using HTTP client to send requests, it is found that request HTTP header is all lowercase.
Such a part of the server will reject my request
How to correct the repair
The text was updated successfully, but these errors were encountered: