Skip to content

Commit afb847f

Browse files
committed
✨ added baseurl
1 parent 775c77a commit afb847f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Fetch.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Fetch
3333
// `baseURL` will be prepended to `url` unless `url` is absolute.
3434
// It can be convenient to set `baseURL` for an instance of axios to pass relative URLs
3535
// to methods of that instance.
36-
"baseURL" => "",
36+
"baseUrl" => "",
3737

3838
// `transformRequest` allows changes to the request data before it is sent to the server
3939
// This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE'
@@ -181,7 +181,7 @@ class Fetch
181181

182182
public static function baseUrl($url)
183183
{
184-
static::$options["baseURL"] = $url;
184+
static::$options["baseUrl"] = $url;
185185
}
186186

187187
/**
@@ -265,12 +265,10 @@ private static function call($request)
265265
}
266266

267267
$request["url"] .= urldecode(http_build_query(self::buildHTTPCurlQuery($request["data"])));
268-
269-
echo $request["url"];
270268
}
271269

272270
$curl_base_options = [
273-
CURLOPT_URL => $request["url"],
271+
CURLOPT_URL => $request["baseUrl"] . $request["url"],
274272
CURLOPT_RETURNTRANSFER => true,
275273
CURLOPT_FOLLOWLOCATION => true,
276274
CURLOPT_MAXREDIRS => $request["maxRedirects"],

0 commit comments

Comments
 (0)