Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F21588635
http_request.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
481 B
Referenced Files
None
Subscribers
None
http_request.ts
View Options
// returning any as this function is only supposed to be used for tests
export
async
function
post
(
url
:
string
,
body
:
Record
<
string
,
unknown
>
)
:
Promise
<
any
>
{
const
response
=
await
fetch
(
url
,
{
method
:
"post"
,
headers
:
{
"Content-Type"
:
"application/json"
,
},
body
:
JSON
.
stringify
(
body
),
});
if
(
!
response
.
status
.
toString
().
startsWith
(
"2"
))
{
throw
{
response
:
{
data
:
await
response
.
json
(),
...
response
}
};
}
const
json
=
response
.
json
();
return
json
;
}
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Sat, Nov 7, 14:35 (17 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1181772
Default Alt Text
http_request.ts (481 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline