Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F3010637
async-request.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
525 B
Referenced Files
None
Subscribers
None
async-request.ts
View Options
import
{
request
,
RequestOptions
}
from
"http"
;
export
default
async
function
asyncRequest
(
options
:
RequestOptions
,
form_data
?:
string
)
:
Promise
<
Record
<
string
,
unknown
>>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
try
{
const
req
=
request
(
options
,
(
res
)
=>
{
res
.
setEncoding
(
"utf-8"
);
res
.
on
(
"data"
,
(
chunk
)
=>
{
resolve
(
JSON
.
parse
(
chunk
));
});
});
req
.
on
(
"error"
,
reject
);
form_data
&&
req
.
write
(
form_data
);
req
.
end
();
}
catch
(
e
)
{
console
.
error
(
e
);
reject
(
e
);
}
});
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Wed, May 7, 19:45 (1 d, 6 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
631336
Default Alt Text
async-request.ts (525 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment