weex icon indicating copy to clipboard operation
weex copied to clipboard

stream.fetch,增加一个headers的属性报405错误,method显示Options,

Open 1021727984 opened this issue 9 years ago • 6 comments

    stream.fetch({
      method: 'GET',
      url: `${baseURL}/${path}`,
      type: 'json',
      headers: {
         Authorization: 'ssssssss'
      }
    }, (response) => {
      if (response.status == 200) {
        resolve(response)
      }
      else {
        reject(response)
      }
    }, () => {})

请求之后request header 会出现这两个参数 Access-Control-Request-Headers:authorization Access-Control-Request-Method:GET 最后报405错误,request method是Options非法的,如果headers没设置就不会出错

1021727984 avatar Feb 22 '17 03:02 1021727984

这个问题解决了吗?我也遇到了同样的问题

BigBigWen avatar Dec 04 '17 08:12 BigBigWen

hi @1021727984 @BigBigWen Web/iOS/Android 哪个端上出现了这个问题

acton393 avatar Dec 04 '17 08:12 acton393

headers -> header is fine ! @BigBigWen @1021727984

zshshr avatar Dec 04 '17 08:12 zshshr

你抓包看下你请求头 method 是不是 Option? 如果是 GET 说明服务器接收参数有问题。另外你看下请求头里的参数有不符合预期的么?

MrRaindrop avatar Dec 04 '17 08:12 MrRaindrop

This PR/issue doesn't received response since Weex migrated to Apache two years ago and this repository is no longer active yet.

Feel free to ask question in new repository and thanks for your contribution.

YorkShen avatar Feb 18 '19 11:02 YorkShen

This issue is outdated for a long time and will be closed now. You can create a new one if you still have questions.

Hanks10100 avatar May 16 '21 10:05 Hanks10100