Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7860186
http_request.ts
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
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
text/plain
Expires
Wed, Aug 13, 17:17 (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
871151
Default Alt Text
http_request.ts (481 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment