File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { logger } from "@/logger.js" ;
2- import { request , Dispatcher } from "undici" ;
2+ import { request , Dispatcher , FormData } from "undici" ;
33import { InputSource , PageOptions , LocalInputSource } from "@/input/index.js" ;
44
55export const TIMEOUT_SECS_DEFAULT : number = 120 ;
@@ -10,7 +10,7 @@ export interface RequestOptions {
1010 method : any ;
1111 timeoutSecs : number ;
1212 headers : any ;
13- body ?: any ;
13+ body ?: FormData | string ;
1414}
1515
1616export interface BaseHttpResponse {
@@ -40,17 +40,16 @@ export async function sendRequestAndReadResponse(
4040 options : RequestOptions ,
4141) : Promise < BaseHttpResponse > {
4242 const url : string = `https://${ options . hostname } ${ options . path } ` ;
43- logger . debug ( `${ options . method } : ${ url } ` ) ;
4443
44+ logger . debug ( `${ options . method } : ${ url } ` ) ;
4545 const response = await request (
4646 url ,
4747 {
4848 method : options . method ,
4949 headers : options . headers ,
5050 headersTimeout : options . timeoutSecs * 1000 ,
5151 body : options . body ,
52- throwOnError : false ,
53- dispatcher : dispatcher
52+ dispatcher : dispatcher ,
5453 }
5554 ) ;
5655 logger . debug ( "Parsing the response ..." ) ;
Original file line number Diff line number Diff line change 11import { URLSearchParams } from "url" ;
2+ import { FormData } from "undici" ;
23import { InputSource , LocalInputSource } from "@/input/index.js" ;
34import { StringDict } from "@/parsing/stringDict.js" ;
45import {
Original file line number Diff line number Diff line change 11import { URLSearchParams } from "url" ;
2+ import { FormData } from "undici" ;
23import { InputSource , LocalInputSource } from "@/input/index.js" ;
34import { ExecutionPriority } from "@/v1/parsing/common/index.js" ;
45import {
Original file line number Diff line number Diff line change 1+ import { FormData } from "undici" ;
12import { MindeeConfigurationError } from "@/errors/index.js" ;
23
34/**
You can’t perform that action at this time.
0 commit comments