corrections/tweaks to readme
This commit is contained in:
parent
962d77bbde
commit
90a1ea4258
32
README.md
32
README.md
@ -12,7 +12,7 @@ var url = "http://www.some-api.com"
|
|||||||
});
|
});
|
||||||
````
|
````
|
||||||
|
|
||||||
At its core is the `Url` class, which is designed to work seamlessly with strings, as demonstrated with the extension method above. Create a `Url` via a string extension is purly optional though; you can create one explicitly if you prefer:
|
At its core is the `Url` class, which is designed to work seamlessly with strings, as demonstrated with the extension method above. Creating a `Url` via a string extension is purly optional though; you can create one explicitly if you prefer:
|
||||||
|
|
||||||
````C#
|
````C#
|
||||||
var url = new Url("http://www.some-api.com").AppendPathSegment(...
|
var url = new Url("http://www.some-api.com").AppendPathSegment(...
|
||||||
@ -24,7 +24,7 @@ A `Url` also converts back to a string implicitly, so you can use it directly in
|
|||||||
var result = await new HttpClient.GetAsync(url);
|
var result = await new HttpClient.GetAsync(url);
|
||||||
````
|
````
|
||||||
|
|
||||||
Flurl also contains the handy `Url.Combine` method, which is basically a Path.Combine for URLs, ensuring one and only one separator character between segments:
|
Flurl also contains the handy `Url.Combine` method, which is basically a `[Path.Combine](http://msdn.microsoft.com/en-us/library/dd991142.aspx)` for URLs, ensuring one and only one separator character between segments:
|
||||||
|
|
||||||
````C#
|
````C#
|
||||||
var url = Url.Combine("http://www.foo.com/", "/too/", "/many/", "/slashes/", "too", "few");
|
var url = Url.Combine("http://www.foo.com/", "/too/", "/many/", "/slashes/", "too", "few");
|
||||||
@ -44,24 +44,24 @@ Flurl takes care of encoding characters in URLs but takes a different approach w
|
|||||||
|
|
||||||
The `Url` API is small, discoverable, and fairly self-explanatory. For completeness, here are all public methods and properties:
|
The `Url` API is small, discoverable, and fairly self-explanatory. For completeness, here are all public methods and properties:
|
||||||
|
|
||||||
````
|
````C#
|
||||||
Static method:
|
// Static method:
|
||||||
|
|
||||||
Combine(string url, params string[] segments) : string (static)
|
static string Combine(string url, params string[] segments)
|
||||||
|
|
||||||
Instance methods (each with equivalent string extension):
|
// Instance methods (each with equivalent string extension):
|
||||||
|
|
||||||
AppendPathSegment(string segment) : Url
|
Url AppendPathSegment(string segment)
|
||||||
AppendPathSegments(params string[] segments) : Url
|
Url AppendPathSegments(params string[] segments)
|
||||||
AppendPathSegments(IEnumerable<string> segments) : Url
|
Url AppendPathSegments(IEnumerable<string> segments)
|
||||||
SetQueryParam(string name, object value) : Url
|
Url SetQueryParam(string name, object value)
|
||||||
SetQueryParams(object values) : Url
|
Url SetQueryParams(object values)
|
||||||
SetQueryParams(IDictionary values) : Url
|
Url SetQueryParams(IDictionary values)
|
||||||
RemoveQueryParam(string name) : Url
|
Url RemoveQueryParam(string name)
|
||||||
RemoveQueryParams(params string[] names) : Url
|
Url RemoveQueryParams(params string[] names)
|
||||||
RemoveQueryParams(IEnumerable<string> names) : Url
|
Url RemoveQueryParams(IEnumerable<string> names)
|
||||||
|
|
||||||
Properties:
|
// Properties:
|
||||||
|
|
||||||
string Path { get; }
|
string Path { get; }
|
||||||
NameValueCollection QueryParams { get; }
|
NameValueCollection QueryParams { get; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user