forked from EasyHttp/EasyHttp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.txt
48 lines (21 loc) · 927 Bytes
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
*EasyHttp*
Licensed under BSD. For full License and included software licenses please see LICENSE.TXT
Please log all issues are tracked here: http://youtrack.codebetter.com/issues/EHTTP
USAGE
=====
To do a POST with JSON:
var customer = new Customer();
customer.Name = "Joe";
customer.Email = "[email protected]";
var http = new HttpClient();
http.Post("url", customer, HttpContentTypes.ApplicationJson);
To get some data in JSON format:
var http = new HttpClient();
http.Request.Accept = HttpContentTypes.ApplicationJson;
var response = http.Get("url");
dynamic customer = response.DynamicBody;
Console.WriteLine(String.Format("Name: {0} - Email: {1}, customer.Name, customer.Email));
If you want Static:
var customer = response.StaticBody<Customer>();
If you want just raw undecoded text:
var customer = response.RawText;