From 145b5db9474e32ca3430fe35eaa7498d7f26ff95 Mon Sep 17 00:00:00 2001 From: winter Date: Sun, 16 Mar 2025 00:53:52 +0000 Subject: implement poking and such --- misc/send_request_authenticated.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'misc/send_request_authenticated.php') 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 -- cgit v1.3