Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tore.Http.Client

Http Client class library for C# By İ. Volkan Töre.

If you use this library, please star it [ it is free! :) ]. I want to know if real people is using this library or not. Nuget gives no proper info about bots vs. people.

Language: C#.

Nuget package: Tore.Http.Client

License: MIT

Dependencies:
.Net 8.0
Tore.Core 8.0.3+

Changes in v8.0.1:

Upgraded to .Net 8.0

Changes in v8.0.0:

This was named Com.cs and was a part of Tore.Core library.
So the version starts with 8.0.0.
It is now a seperate .net 7.0 library with a nuget package.

Client.cs :

Defines the Client class which manages Http client requests and responses. Client is an all in one Http Client object gathering sub components required for a proper request and its response into an instance. Since client requests and responses differ dramatically, Client objects give both standard and micro managed request types and response handling. It maintains and uses a single static HttpClient object as recommended by Microsoft.

For simple standard http requests use STATIC functions

   Client.Send(...);
   Client.SendAsync(...);
   Client.Talk<T>(...);
   Client.TalkAsync<T>(...);

Otherwise, create a Client object and manipulate the request via

  • The Client instance properties, like: content, accept, mediaType.
  • The Client.request, the HttpRequestMessage property, directly.

Then use INSTANCE send() or sendAsync() routines.

IMPORTANT: Instance content, accept and mediaType properties are transferred to request just before sending it. Tricky assignments must be done via;

  • request.Content,
  • request.Content.Headers.Accept,
  • request.Content.Headers.ContentType.MediaType properties,

When request.content is non null, content property of instance is ignored. If accept or mediaType is set through request.Content.Headers respective Com accept and mediaType properties must be empty.

Please read the comments on the code at least once for using this class efficiently.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages