/** * creates a http connection to specified uri * @param string $uri * @param \stubbles\peer\HeaderList $headers * @return \stubbles\peer\http\HttpConnection * @since 3.1.0 * @api */ function http(string $uri, HeaderList $headers = null) : HttpConnection { return HttpUri::fromString($uri)->connect($headers); }
/** * @test */ public function parseRecognizesHttpsUris() { assert(Parse::toType('https://example.net/'), equals(HttpUri::fromString('https://example.net/'))); }
/** * @test */ public function validHttpUrlWithoutDnsEntryEvaluatesToFalseWhenTestedForExistance() { assertFalse(HttpUri::exists('http://stubbles.doesNotExist/', NewCallable::of('checkdnsrr')->mapCall(false))); }