/
index.html
175 lines (151 loc) · 6 KB
/
index.html
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
---
title: RestSharp - Simple REST and HTTP Client for .NET
---
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>RestSharp - Simple REST and HTTP Client for .NET</title>
<link rel="stylesheet" href="stylesheets/styles.css">
<link rel="stylesheet" href="stylesheets/pygment_trac.css">
<script src="javascripts/scale.fix.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="wrapper">
<header>
<h1>RestSharp</h1>
<p>Simple REST and HTTP API Client for .NET</p>
<p class="view"><a href="https://github.com/restsharp/RestSharp">View the Project on GitHub <small>restsharp/RestSharp</small></a></p>
<ul>
<li><a href="http://nuget.org/packages/RestSharp">Download on <strong>NuGet</strong></a></li>
<li><a href="https://github.com/restsharp/RestSharp">Fork on <strong>GitHub</strong></a></li>
<li><a href="http://groups.google.com/group/restsharp">Get <strong>help</strong></a></li>
</ul>
<p><a href="https://twitter.com/RestSharp" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @RestSharp</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></p>
</header>
<section>
<h3>NEED HELP with RestSharp?</h3>
<p><strong>Post your question to the <a href="http://groups.google.com/group/restsharp">Google Group</a> or <a href="http://stackoverflow.com/questions/tagged/restsharp">StackOverflow</a></strong>. If you think you've found a bug, post it to the group before creating an issue on GitHub.</p>
<p>Pull requests gladly accepted, but if it's a big change you should discuss it with the group first to make sure it fits into the goals and plans of the project.</p>
<h4><a href="https://github.com/restsharp/RestSharp/wiki/Submission-Guidelines">Contribution Guidelines</a></h4>
<h4><a href="https://github.com/restsharp/RestSharp/wiki">Documentation</a></h4>
<h4><a href="https://github.com/restsharp/RestSharp/wiki/Acknowledgements">Contributors and Acknowledgements</a></h4>
<h3>Important change in version 103.0.0</h3>
<p>Version 103 removed JSON.NET as a dependency. <a href="https://github.com/restsharp/RestSharp/blob/master/readme.txt">Please read this</a>
and <a href="https://groups.google.com/d/msg/restsharp/yjGCtOnEYHk/XbKZi0yjN8cJ">this</a>.
</p>
<h3>Examples</h3>
{% highlight csharp %}
var client = new RestClient("http://example.com");
// client.Authenticator = new HttpBasicAuthenticator(username, password);
var request = new RestRequest("resource/{id}", Method.POST);
request.AddParameter("name", "value"); // adds to POST or URL querystring based on Method
request.AddUrlSegment("id", 123); // replaces matching token in request.Resource
// easily add HTTP Headers
request.AddHeader("header", "value");
// add files to upload (works with compatible verbs)
request.AddFile(path);
// execute the request
RestResponse response = client.Execute(request);
var content = response.Content; // raw content as string
// or automatically deserialize result
// return content type is sniffed but can be explicitly set via RestClient.AddHandler();
RestResponse<Person> response2 = client.Execute<Person>(request);
var name = response2.Data.Name;
// easy async support
client.ExecuteAsync(request, response => {
Console.WriteLine(response.Content);
});
// async with deserialization
var asyncHandle = client.ExecuteAsync<Person>(request, response => {
Console.WriteLine(response.Data.Name);
});
// abort the request on demand
asyncHandle.Abort();
{% endhighlight %}
<h3>The Latest</h3>
<script charset="utf-8" src="http://widgets.twimg.com/j/2/widget.js"></script>
<div style="float:left;">
<script>
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 10,
interval: 30000,
width: 500,
height: 500,
theme: {
shell: {
background: '#eeeeee',
color: '#555555'
},
tweets: {
background: '#ffffff',
color: '#000000',
links: '#3399cc'
}
},
features: {
scrollbar: false,
loop: false,
live: true,
behavior: 'all'
}
}).render().setUser('RestSharp').start();
</script>
</div>
<div style="float:left;">
<script>
new TWTR.Widget({
version: 2,
type: 'search',
search: 'restsharp',
interval: 30000,
title: 'RestSharp',
subject: 'Across the Twitters',
width: 500,
height: 500,
theme: {
shell: {
background: '#eeeeee',
color: '#555555'
},
tweets: {
background: '#ffffff',
color: '#000000',
links: '#3399cc'
}
},
features: {
scrollbar: false,
loop: false,
live: true,
behavior: 'all'
}
}).render().start();
</script>
</div>
</section>
<footer>
<p><small>Hosted on GitHub Pages — Theme by <a href="https://github.com/orderedlist">orderedlist</a></small></p>
</footer>
</div>
<!--[if !IE]><script>fixScale(document);</script><!--<![endif]-->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-8399155-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>