* @param curlStr curl 字符串 * @param options 配置项
(
curlStr: string,
options?: {
ignoreDisabledHeaders: boolean
}
)
| 72 | * @param options 配置项 |
| 73 | */ |
| 74 | constructor( |
| 75 | curlStr: string, |
| 76 | options?: { |
| 77 | ignoreDisabledHeaders: boolean |
| 78 | } |
| 79 | ) { |
| 80 | this.curlStr = curlStr |
| 81 | this.options = options || this.options |
| 82 | this.validateCurl() |
| 83 | this.parseCurl() |
| 84 | this.ignoreDisabledHeader() |
| 85 | this.resetMethods() |
| 86 | this.parseObj.requestParams = this.getRequestBody2json() |
| 87 | } |
| 88 | |
| 89 | /** 基础校验,验证 curl 字符串的合法性 */ |
| 90 | validateCurl(): string | void { |
nothing calls this directly
no test coverage detected