Skip to content

Commit

Permalink
std.net.curl: Fix broken HTTP PUT example
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberShadow committed Sep 18, 2012
1 parent 94738ad commit 39f7ea6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions std/net/curl.d
Original file line number Diff line number Diff line change
Expand Up @@ -1890,14 +1890,15 @@ private bool decodeLineInto(Terminator, Char = char)(ref const(ubyte)[] basesrc,
*
* // Put with data senders
* auto msg = "Hello world";
* http.contentLength = msg.length;
* http.onSend = (void[] data)
* {
* auto m = cast(void[])msg;
* size_t length = m.length > data.length ? data.length : m.length;
* if (length == 0) return 0;
* data[0..length] = m[0..length];
* msg = msg[length..$];
* return length;
* size_t len = m.length > data.length ? data.length : m.length;
* if (len == 0) return len;
* data[0..len] = m[0..len];
* msg = msg[len..$];
* return len;
* };
* http.perform();
*
Expand Down

0 comments on commit 39f7ea6

Please sign in to comment.