AxiosError:请求失败,状态码为 405

问题描述 投票:0回答:0

我正在尝试通过 axios 的 post 方法调用 jira 的 API

我的 ssl 标头和停用如下:

const config = {
       headers : {
      'Authorization': `Bearer ${ token }`,
      'Content-Type': 'application/json',
    },
     httpsAgent : new https.Agent( {
      rejectUnauthorized: false,
      requestCert: false,
    } )
  }

和我的发帖方式:

this.httpService.axiosRef.interceptors.response.use(
      config => { console.log( config ); return config } );
    
    const { data } = await lastValueFrom( this.httpService.post( jiraUrl, dataInpput, config )
      .pipe( catchError( ( error: AxiosError ) => {
        console.log( error ); throw 'An error happened!';
      } )
      )
    );
    return data;

但是我遇到了 405 错误 statusMessage: '方法不允许'

axios nestjs authorization
© www.soinside.com 2019 - 2024. All rights reserved.