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

Run preparation methods on all HttpClient.Send() overloads #414

Merged

Conversation

patagonaa
Copy link
Contributor

Description

  • Override HttpMessageInvoker.Send(HttpRequestMessage) in HttpClient to always do the neccessary preparations (apply the given DefaultRequestHeaders, BaseAddress, Timeout and TLS settings).

Motivation and Context

How Has This Been Tested?

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dependencies (update dependencies and changes associated, has no impact on code or features)
  • Unit Tests (add new Unit Test(s) or improved existing one(s), has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist:

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).
  • I have added new tests to cover my changes.

fix issue where calling httpClient.Send(HttpRequestMessage) will not
apply the given DefaultRequestHeaders, BaseAddress and TLS settings
@nfbot nfbot added the Type: bug label Apr 2, 2024
Copy link
Member

@Ellerbach Ellerbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks looks good. Same issue with the pipeline as your other PR, so it's not on you.

@josesimoes josesimoes changed the title run preparation methods on all HttpClient.Send() overloads Run preparation methods on all HttpClient.Send() overloads Apr 2, 2024
@josesimoes josesimoes merged commit be8176e into nanoframework:main Apr 3, 2024
5 checks passed
@nfbot
Copy link
Member

nfbot commented Apr 3, 2024

@patagonaa thank you again for your contribution! 🙏😄

.NET nanoFramework it's all about community involvement and no contribution is too small.
We would like to invite you to join the project Contributors list.

Please edit it and add an entry with your GitHub user in the appropriate location (names sorted alphabetically):

  <tr>
    <td><img src="https://github.com/patagonaa.png?size=50&" height="50" width="50" ></td>
    <td><a href="https://github.com/patagonaa">Patrick</a></td>
  </tr>

(feel free to adjust your name, if it's not correct)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HttpClient.DefaultRequestHeaders not applied for all Send overloads
4 participants