Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • D

Idiom #101 Load from HTTP GET request into a string

Make an HTTP request with method GET to the URL u, then store the body of the response in the string s.

import std.net.curl;
import std.conv;
string s = u.get.to!string;

u is a string.
(def s (slurp u))

New implementation...