Skip to content

Commit 2d6927a

Browse files
Fix examples and docs in [std/net/curl.d]
1 parent 79d1c0f commit 2d6927a

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

std/net/curl.d

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2175,7 +2175,7 @@ private mixin template Protocol()
21752175
* auto client = HTTP("dlang.org");
21762176
* client.onReceive = (ubyte[] data)
21772177
* {
2178-
* writeln("Got data", to!(const(char)[])(data));
2178+
* writeln("Got data", bitCast!(const(char)[])(data));
21792179
* return data.length;
21802180
* };
21812181
* client.perform();
@@ -2834,7 +2834,7 @@ struct HTTP
28342834
* auto client = HTTP("dlang.org");
28352835
* client.onReceive = (ubyte[] data)
28362836
* {
2837-
* writeln("Got data", to!(const(char)[])(data));
2837+
* writeln("Got data", bitCast!(const(char)[])(data));
28382838
* return data.length;
28392839
* };
28402840
* client.perform();
@@ -2991,7 +2991,11 @@ struct HTTP
29912991
return p.headersIn;
29922992
}
29932993

2994-
/// HTTP method used.
2994+
/**
2995+
* HTTP method used.
2996+
*
2997+
* See_Also: $(LREF Method)
2998+
*/
29952999
@property void method(Method m)
29963000
{
29973001
p.method = m;
@@ -3069,7 +3073,7 @@ struct HTTP
30693073
* ----
30703074
* import std.net.curl, std.stdio, std.conv;
30713075
* auto http = HTTP("http://www.mydomain.com");
3072-
* http.onReceive = (ubyte[] data) { writeln(to!(const(char)[])(data)); return data.length; };
3076+
* http.onReceive = (ubyte[] data) { writeln(bitCast!(const(char)[])(data)); return data.length; };
30733077
* http.postData = [1,2,3,4,5];
30743078
* http.perform();
30753079
* ----
@@ -3088,7 +3092,7 @@ struct HTTP
30883092
* ----
30893093
* import std.net.curl, std.stdio, std.conv;
30903094
* auto http = HTTP("http://www.mydomain.com");
3091-
* http.onReceive = (ubyte[] data) { writeln(to!(const(char)[])(data)); return data.length; };
3095+
* http.onReceive = (ubyte[] data) { writeln(bitCast!(const(char)[])(data)); return data.length; };
30923096
* http.postData = "The quick....";
30933097
* http.perform();
30943098
* ----
@@ -3107,6 +3111,8 @@ struct HTTP
31073111
* "application/octet-stream". See also:
31083112
* $(LINK2 http://en.wikipedia.org/wiki/Internet_media_type,
31093113
* Internet media type) on Wikipedia.
3114+
*
3115+
* Example:
31103116
* -----
31113117
* import std.net.curl;
31123118
* auto http = HTTP("http://onlineform.example.com");
@@ -3160,7 +3166,7 @@ struct HTTP
31603166
* ----
31613167
* import std.net.curl, std.stdio, std.conv;
31623168
* auto http = HTTP("dlang.org");
3163-
* http.onReceive = (ubyte[] data) { writeln(to!(const(char)[])(data)); return data.length; };
3169+
* http.onReceive = (ubyte[] data) { writeln(bitCast!(const(char)[])(data)); return data.length; };
31643170
* http.onReceiveHeader = (in char[] key, in char[] value) { writeln(key, " = ", value); };
31653171
* http.perform();
31663172
* ----
@@ -4568,7 +4574,7 @@ struct Curl
45684574
* Curl curl;
45694575
* curl.initialize();
45704576
* curl.set(CurlOption.url, "http://dlang.org");
4571-
* curl.onReceive = (ubyte[] data) { writeln("Got data", to!(const(char)[])(data)); return data.length;};
4577+
* curl.onReceive = (ubyte[] data) { writeln("Got data", bitCast!(const(char)[])(data)); return data.length;};
45724578
* curl.perform();
45734579
* ----
45744580
*/

0 commit comments

Comments
 (0)