Skip to content

fix:修复使用fetch请求传输json数据报错的问题 #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

WN0904
Copy link

@WN0904 WN0904 commented Sep 27, 2024

Summary

  • closes 使用fetch请求传输json数据报错 #34
  • :修复使用fetch请求传输json数据报错getABData fail,check file is exists
  • 在判断传输的数据是否为地址时不使用indexof使用startsWith返回Boolean值

Test Plan

复现代码

 const response = await RNFetchBlob.config({
      // Add this line to ensure the response will be treated as binary data
      fileCache: false,
    }).fetch(
      'POST',
      global.URL_XUNJI + uri,
      {
        'Content-Type': 'application/json',
        'Accept-Encoding': 'gzip',
        Authorization: `Bearer ${global.token}`,
      },
      JSON.stringify(body),
    );

Checklist

  • 已经在真机设备或模拟器上测试通过
  • 已经与 Android 或 iOS 平台做过效果/功能对比
  • 已经添加了对应 API 的测试用例(如需要)
  • 已经更新了文档(如需要)
  • 更新了 JS/TS 代码 (如有)

@mingmingaini mingmingaini merged commit 3afb46a into react-native-oh-library:sig Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

使用fetch请求传输json数据报错
2 participants