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

Add support for using a custom HttpClient or HttpMessageHandler #1

Closed
fubar-coder opened this issue Feb 8, 2017 · 12 comments
Closed
Assignees

Comments

@fubar-coder
Copy link

It would be useful when you would be able to provide a custom HttpClient or HttpMessageHandler. This would allow the usage of the client in the following scenarios:

  • Test for ASP.NET Core using the TestHost (with custom HttpMessageHandler or HttpClient)
  • Usage on Android and iOS (with custom HttpMessageHandler)
@StefH
Copy link
Owner

StefH commented Feb 8, 2017

Adding a custom HttpClient is possible. Do you also need another option to provide a custom HttpMessageHandler?

@StefH StefH self-assigned this Feb 8, 2017
@fubar-coder
Copy link
Author

Having both options would be nice, but I'd prefer the ability to use a custom HttpMessageHandler, because that would allow the usage of implementations like NativeMessageHandler from Paul Betts.

@StefH
Copy link
Owner

StefH commented Feb 8, 2017

I did update the constructors, please take a look if this is fine for you. (See latest code in this github project)

@fubar-coder
Copy link
Author

Seems to be what I was looking for 👍 .

Just one thing, can you please add an additional net46 target which uses the System.Net.Http nuget package instead of the framework assemblies? I guess that System.Net.Http contains a bug fix for net46, because it supplies its own assembly (but uses the framework assemblies for net45).

@StefH
Copy link
Owner

StefH commented Feb 8, 2017

You want the 4.3.0 versipn I guess? And only for 4.6 ?

@fubar-coder
Copy link
Author

I think that a lower version might be fine. You can always upgrade yourself, but a downgrade gets difficult.

@StefH
Copy link
Owner

StefH commented Feb 8, 2017

For now I just used 4.3.0

See NuGet from this feed:
https://www.myget.org/F/webdav-client/api/v3/index.json

If this one works fine; I will upload to real NuGet

@fubar-coder
Copy link
Author

Works fine with my ASP.NET Core test project

@StefH
Copy link
Owner

StefH commented Feb 8, 2017

Can you also chexk for a 462 project?

@fubar-coder
Copy link
Author

Sure, but not today anymore.

@fubar-coder
Copy link
Author

Running tests in a net462 project works too.

@StefH
Copy link
Owner

StefH commented Feb 10, 2017

Uploaded to NuGet.org

@StefH StefH closed this as completed Feb 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants