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

options headers key lowercase #788

Closed
LiangLuDev opened this issue May 15, 2020 · 2 comments · Fixed by #2008
Closed

options headers key lowercase #788

LiangLuDev opened this issue May 15, 2020 · 2 comments · Fixed by #2008

Comments

@LiangLuDev
Copy link

    Options options = Options();
    options.headers['AppID'] = '2000004950';
    var response = await http.post<Map>('/api/checkcfg/2000004950',
        data: {
          "keywords": firmwareVersion,
          "cmpmethod": 1,
          "version": version,
          "imei": imei,
        },
        options: options
    );

print

headers : {content-type: application/json; charset=utf-8, appid: 2000004950, Timestamp: 1589550316, Sign: , Connection: close}

but can use InterceptorsWrapper

class HeaderInterceptor extends InterceptorsWrapper {
  @override
  onRequest(RequestOptions options) async {
    options.connectTimeout = 1000 * 45;
    options.receiveTimeout = 1000 * 45;
    options.headers['AppID'] = '2000005054';
    debugPrint('HeaderInterceptor : ${options.headers}');
    return options;
  }
}

log print

headers : {content-type: application/json; charset=utf-8, appid: 2000004950, AppID: 2000005054, Timestamp: 1589551032, Sign: , Connection: close}
@shaxxx
Copy link

shaxxx commented May 18, 2020

Possible duplicate of #641

@stale
Copy link

stale bot commented Jun 17, 2020

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 17, 2020
@stale stale bot closed this as completed Jun 24, 2020
@AlexV525 AlexV525 mentioned this issue Oct 23, 2023
7 tasks
@AlexV525 AlexV525 linked a pull request Oct 23, 2023 that will close this issue
7 tasks
github-merge-queue bot pushed a commit that referenced this issue Nov 25, 2023
Fixes #2002 #1102 #788 #641

### New Pull Request Checklist

- [x] I have read the
[Documentation](https://pub.dev/documentation/dio/latest/)
- [x] I have searched for a similar pull request in the
[project](https://github.com/cfug/dio/pulls) and found none
- [x] I have updated this branch with the latest `main` branch to avoid
conflicts (via merge from master or rebase)
- [x] I have added the required tests to prove the fix/feature I'm
adding
- [x] I have updated the documentation (if necessary)
- [x] I have run the tests without failures
- [x] I have updated the `CHANGELOG.md` in the corresponding package

### Additional context and info (if any)

We have `camelCaseContentDisposition` for `FormData` but this is not
related.

---------

Signed-off-by: Alex Li <[email protected]>
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

Successfully merging a pull request may close this issue.

2 participants