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

Use System.Net.Http instead of Windows.Web.Http #232

Open
SunboX opened this issue Jul 21, 2017 · 4 comments
Open

Use System.Net.Http instead of Windows.Web.Http #232

SunboX opened this issue Jul 21, 2017 · 4 comments

Comments

@SunboX
Copy link
Member

SunboX commented Jul 21, 2017

In Windows 10, the implementation of the System.Net.Http API for UWP has been changed to layer it on top of Windows.Web.Http and the WinINet HTTP stack of Windows.

System.Net.Http seems more general and more widely used. We should change our implementation to use the "new" API.

See: Demystifying HttpClient APIs in the Universal Windows Platform

@SunboX
Copy link
Member Author

SunboX commented Jul 21, 2017

HTTP/2 Support (Windows 10)

HTTP/2 is a new version of the HTTP protocol that provides much better connection utilization (fewer round-trips between client and server), resulting in lower latency web page loading for users. Web pages (as opposed to services) benefit the most from HTTP/2, since the protocol optimizes for multiple artifacts being requested as part of a single experience. HTTP/2 support has been added to ASP.NET in the .NET Framework 4.6. Because networking functionality exists at multiple layers, new features were required in Windows, in IIS, and in ASP.NET to enable HTTP/2. You must be running on Windows 10 to use HTTP/2 with ASP.NET.

HTTP/2 is also supported and on by default for Windows 10 Universal Windows Platform (UWP) apps that use the System.Net.Http.HttpClient API.
➡️ What's new in the .NET Framework

@xrkolovos
Copy link

@mqudsi
Copy link

mqudsi commented Dec 25, 2017

System.Net.Http is implemented atop of Windows.Web.Http

For example, here's a stacktrace:

>	KernelBase.dll!RaiseException�()	Unknown	Non-user code. Symbols loaded.
 	combase.dll!SendReport(HRESULT error=0x8000000b, unsigned int cchMax=0, const wchar_t * message=0x00007ff854b2d8e4, unsigned short pSid=0x0000000000000000, void * pExceptionObject=0x0000000000000000, IUnknown *) Line 438	C++	Non-user code. Symbols loaded.
 	combase.dll!RoOriginateError(HRESULT error=0x8000000b, HSTRING__ * message) Line 590	C++	Non-user code. Symbols loaded.
 	Windows.Web.Http.dll!Windows::Foundation::Collections::Internal::HashMap<struct HSTRING__ *,struct HSTRING__ *,struct StringCaseInsensitiveHash,struct StringCaseInsensitiveEquals,struct Windows::Foundation::Collections::Internal::DefaultLifetimeTraits<struct HSTRING__ *>,struct Windows::Foundation::Collections::Internal::DefaultLifetimeTraits<struct HSTRING__ *>,struct Windows::Foundation::Collections::Internal::HashMapOptions<struct HSTRING__ *,struct HSTRING__ *,struct Windows::Foundation::Collections::Internal::DefaultLifetimeTraits<struct HSTRING__ *>,0,1,0> >::Remove(struct HSTRING__ *)	Unknown	Non-user code. Symbols loaded.
 	Windows.Web.Http.dll!HttpHeaderCollectionBase::Remove(struct HSTRING__ *)	Unknown	Non-user code. Symbols loaded.
 	Windows.Web.Http.dll!HttpHeaderCollectionBase::TryRemoveHeaderValueInfo(struct HSTRING__ *)	Unknown	Non-user code. Symbols loaded.
 	Windows.Web.Http.dll!HttpHeaderCollectionBase::SetParsedValue(unsigned short const *,struct IInspectable *)	Unknown	Non-user code. Symbols loaded.
 	[Managed to Native Transition]		Annotated Frame
 	System.Net.Http.dll!System.Net.Http.HttpHandlerToFilter.CreateRequestContentAsync(System.Net.Http.HttpRequestMessage request = {System.Net.Http.HttpRequestMessage}, Windows.Web.Http.Headers.HttpRequestHeaderCollection rtHeaderCollection = {Windows.Web.Http.Headers.HttpRequestHeaderCollection})	Unknown	Non-user code. Skipped loading symbols.
 	System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.__Canon>.Start<System.Net.Http.HttpHandlerToFilter.<CreateRequestContentAsync>d__19>(ref System.Net.Http.HttpHandlerToFilter.<CreateRequestContentAsync>d__19 stateMachine)	Unknown	Non-user code. Skipped loading symbols.
 	System.Net.Http.dll!System.Net.Http.HttpHandlerToFilter.CreateRequestContentAsync(System.Net.Http.HttpRequestMessage request, Windows.Web.Http.Headers.HttpRequestHeaderCollection rtHeaderCollection)	Unknown	Non-user code. Skipped loading symbols.
 	System.Net.Http.dll!System.Net.Http.HttpHandlerToFilter.ConvertRequestAsync(System.Net.Http.HttpRequestMessage request = {System.Net.Http.HttpRequestMessage}, System.Net.Http.HttpMethod httpMethod = {System.Net.Http.HttpMethod}, bool skipRequestContentIfPresent = false)	Unknown	Non-user code. Skipped loading symbols.
 	System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.__Canon>.Start<System.Net.Http.HttpHandlerToFilter.<ConvertRequestAsync>d__18>(ref System.Net.Http.HttpHandlerToFilter.<ConvertRequestAsync>d__18 stateMachine)	Unknown	Non-user code. Skipped loading symbols.
 	System.Net.Http.dll!System.Net.Http.HttpHandlerToFilter.ConvertRequestAsync(System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpMethod httpMethod, bool skipRequestContentIfPresent)	Unknown	Non-user code. Skipped loading symbols.
 	System.Net.Http.dll!System.Net.Http.HttpHandlerToFilter.SendAsync(System.Net.Http.HttpRequestMessage request = {System.Net.Http.HttpRequestMessage}, System.Threading.CancellationToken cancel = IsCancellationRequested = false)	Unknown	Non-user code. Skipped loading symbols.
 	System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.__Canon>.Start<System.Net.Http.HttpHandlerToFilter.<SendAsync>d__15>(ref System.Net.Http.HttpHandlerToFilter.<SendAsync>d__15 stateMachine)	Unknown	Non-user code. Skipped loading symbols.
 	System.Net.Http.dll!System.Net.Http.HttpHandlerToFilter.SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancel)	Unknown	Non-user code. Skipped loading symbols.
 	System.Net.Http.dll!System.Net.Http.HttpClientHandler.SendAsync(System.Net.Http.HttpRequestMessage request = {System.Net.Http.HttpRequestMessage}, System.Threading.CancellationToken cancellationToken = IsCancellationRequested = false)	Unknown	Non-user code. Skipped loading symbols.
 	System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.__Canon>.Start<System.Net.Http.HttpClientHandler.<SendAsync>d__111>(ref System.Net.Http.HttpClientHandler.<SendAsync>d__111 stateMachine)	Unknown	Non-user code. Skipped loading symbols.
 	System.Net.Http.dll!System.Net.Http.HttpClientHandler.SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken)	Unknown	Non-user code. Skipped loading symbols.
 	System.Net.Http.dll!System.Net.Http.HttpMessageInvoker.SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken)	Unknown	Non-user code. Skipped loading symbols.
 	System.Net.Http.dll!System.Net.Http.HttpClient.SendAsync(System.Net.Http.HttpRequestMessage request = {System.Net.Http.HttpRequestMessage}, System.Net.Http.HttpCompletionOption completionOption = ResponseHeadersRead, System.Threading.CancellationToken cancellationToken)	Unknown	Non-user code. Skipped loading symbols.
 	System.Net.Requests.dll!System.Net.HttpWebRequest.SendRequest()	Unknown	Non-user code. Skipped loading symbols.
 	System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.__Canon>.Start<System.Net.HttpWebRequest.<SendRequest>d__194>(ref System.Net.HttpWebRequest.<SendRequest>d__194 stateMachine)	Unknown	Non-user code. Skipped loading symbols.
 	System.Net.Requests.dll!System.Net.HttpWebRequest.SendRequest()	Unknown	Non-user code. Skipped loading symbols.
 	System.Net.Requests.dll!System.Net.HttpWebRequest.BeginGetResponse(System.AsyncCallback callback = {System.AsyncCallback}, object state = {System.Net.HttpWebRequest})	Unknown	Non-user code. Skipped loading symbols.
 	System.Private.CoreLib.dll!System.Threading.Tasks.TaskFactory<System.Net.WebResponse>.FromAsyncImpl(System.Func<System.AsyncCallback, object, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, System.Net.WebResponse> endFunction, System.Action<System.IAsyncResult> endAction, object state, System.Threading.Tasks.TaskCreationOptions creationOptions)	Unknown	Non-user code. Skipped loading symbols.
 	System.Net.Requests.dll!System.Net.WebRequest.GetResponseAsync.AnonymousMethod__68_0()	Unknown	Non-user code. Skipped loading symbols.
 	System.Private.CoreLib.dll!System.Threading.Tasks.Task<System.Threading.Tasks.Task<System.Net.WebResponse>>.InnerInvoke()	Unknown	Non-user code. Skipped loading symbols.
 	System.Private.CoreLib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state)	Unknown	Non-user code. Skipped loading symbols.
 	System.Private.CoreLib.dll!System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref System.Threading.Tasks.Task currentTaskSlot = Id = 3324, Status = Running, Method = Inspecting the state of an object in the debuggee of type System.Delegate is not supported in this context., Result = Cannot evaluate expression because a native frame is on the top of the call stack.)	Unknown	Non-user code. Skipped loading symbols.
 	System.Private.CoreLib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch()	Unknown	Non-user code. Skipped loading symbols.

@xrkolovos
Copy link

@mqudsi it depends the runtime(uwp,.net frm, .net core, xamarin, etc). Windows.Web.Http is windows specific. Using System.Net.Http you can target all the .net ecosystem.

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

3 participants