aboutsummaryrefslogtreecommitdiffhomepage
path: root/misc/send_request_authenticated.php
diff options
context:
space:
mode:
Diffstat (limited to 'misc/send_request_authenticated.php')
-rw-r--r--misc/send_request_authenticated.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/misc/send_request_authenticated.php b/misc/send_request_authenticated.php
index 9019da8..6e74cac 100644
--- a/misc/send_request_authenticated.php
+++ b/misc/send_request_authenticated.php
@@ -16,7 +16,8 @@ function send_request_authenticated(
string $uri,
bool $dontLookUpInstance = false,
string $method = 'GET',
- ?Actor $actingAs = null
+ ?Actor $actingAs = null,
+ ?string $body = null
) {
if (!str_starts_with($uri, 'https://')) {
throw new RuntimeException('refusing to fetch a non-https uri');
@@ -34,7 +35,7 @@ function send_request_authenticated(
if (!isset($instance->auth->outboundToken) || $instance->auth->outboundToken == null) {
// hopefully we can make the request anyway?
- $context = stream_context_create(['http' => ['method' => $method]]);
+ $context = stream_context_create(['http' => ['method' => $method, 'content' => $body]]);
$resp = file_get_contents($uri);
// $http_response_header just poofs into existence .
// i don't like this api. i should probably use curl instead. hmm