-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Roman Vladimirov edited this page May 28, 2017
·
6 revisions
Fuuko is small library based on HttpClient class. It allows to make HTTP queries in declarative style (like Linq). The purpose of this project is to make the execution of HTTP requests easier.
- Parameters - Description of how to define and change parameters.
- Cookie - Use cookies in queries
- Url - This parameter can be static or dynamic from a query to a query, depending on the need.
- Headers - Description how to add headers to query
- Fluent execution - This api allows you to configure queries in various ways
Get google search page
//Create instance HttpFluentRequest and pass into first parameter NetHttpBroker.
var response = new HttpFluentRequest ( new NetHttpBroker () )
.Url ( "https://www.google.ru/webhp" ) //define full url
.Method ( RequestMethod.Get ) // define HTTP method
.Parameter ( "q" , "cats" ) // define parameter q=cats
.Parameter ( "ie" , "UTF-8" ) // define parameter ie=UTF-8
.Send (); //send request synchronized
//output to console some response properties
Console.WriteLine ( "Content-Type: {0}" , response.Response.ContentType );
Console.WriteLine ( "Content-Length: {0}" , response.Response.ContentLength );
Console.WriteLine ( "Status: {0}" , response.Response.StatusCode );
Console.WriteLine ( "Protocol version: {0}" , response.Response.ProtocolVersion );
Console.WriteLine ( "Content: {0}" , response.GetContentAsString ( Encoding.UTF8 ) );