Skip to content
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

[WEB] content-type header missing #1045

Closed
BartusZak opened this issue Feb 13, 2021 · 2 comments
Closed

[WEB] content-type header missing #1045

BartusZak opened this issue Feb 13, 2021 · 2 comments

Comments

@BartusZak
Copy link

headersTest

{content-type: application/json, Accept: application/json}
      headersTest[HttpHeaders.contentTypeHeader] = Headers.jsonContentType;
     
      final test = await Dio().get(url,
          options: Options(
              headers: headersTest, contentType: Headers.jsonContentType));

Content-Type is missing in request header

fetch("https://0opomxj3i3.execute-api.eu-west-1.amazonaws.com/dev/rooms/main", {
  "headers": {
    "accept": "application/json",
    "accept-language": "pl-PL,pl;q=0.9,en-US;q=0.8,en;q=0.7",
  },
  "referrer": "http://localhost:53320/",
  "referrerPolicy": "no-referrer-when-downgrade",
  "body": null,
  "method": "GET",
  "mode": "cors",
  "credentials": "include"
});
Flutter 1.26.0-17.3.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 4b50ca7f7f (8 days ago) • 2021-02-04 19:44:27 -0800
Engine • revision 2c527d6c7e
Tools • Dart 2.12.0 (build 2.12.0-259.8.beta)

dio: ^3.0.10

@BartusZak
Copy link
Author

That's probably bug because I was not able to set it with lowercase content-type.

Content-Type works.

options.headers = {'Content-Type': 'application/json', ...request.headers};

@stale
Copy link

stale bot commented Jun 18, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions.

@stale stale bot added the stale label Jun 18, 2021
@stale stale bot closed this as completed Jun 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant