aboutsummaryrefslogtreecommitdiffhomepage
path: root/misc
diff options
context:
space:
mode:
authorwinter2025-03-16 00:53:52 +0000
committerwinter2025-03-16 00:53:52 +0000
commit145b5db9474e32ca3430fe35eaa7498d7f26ff95 (patch)
treedf1da516a05cd382e19a815d4e7e6bee314e3007 /misc
parenta0a86c3a98a6af158ecd2f1923feb752c82907db (diff)
implement poking and such
Diffstat (limited to 'misc')
-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