import { ObjectLiteral } from "./utils" ; import { URLSearchParams } from "url" ; import fetch , { Response } from "node-fetch" ; export async function postForm ( url , body ) { const formBody = new URLSearchParams ( ) ; Object . entries ( body ) . forEach ( ( entry ) => { const key = entry [ 0 ] ; const value = entry [ 1 ] ; formBody . append ( key , value ) ; } ) ; return fetch ( url , { method : "POST" , body : formBody , redirect : "manual" , } ) ; }