We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e238ae commit 85ed092Copy full SHA for 85ed092
src/Fetch.php
@@ -453,7 +453,21 @@ public static function buildHTTPCurlQuery($data, $parent = false)
453
}
454
455
456
-function fetch($options)
+/**
457
+ * Shortcut method for making network requests.
458
+ *
459
+ * @param array|string $options The url or request to hit.
460
+ */
461
+function fetch($options, $params = [])
462
{
463
+ if (is_string($options)) {
464
+ $options = ["url" => $options];
465
+
466
+ if (count($params) > 0) {
467
+ $options["method"] = Fetch::POST;
468
+ $options["data"] = $params;
469
+ }
470
471
472
return Fetch::request($options);
473
0 commit comments