瀏覽代碼

Change README.md

Ben Hsieh 9 年之前
父節點
當前提交
ea4544ba41
共有 1 個檔案被更改,包括 25 行新增7 行删除
  1. 25
    7
      README.md

+ 25
- 7
README.md 查看文件

1
-# react-native-fetch-blob [![npm version](https://img.shields.io/badge/npm package-0.6.0-brightgreen.svg?style=flat-square)](https://badge.fury.io/js/react-native-fetch-blob?style=flat-square) ![](https://img.shields.io/badge/PR-Welcome-brightgreen.svg?style=flat-square)
2
-
3
-# v0.6.0 WIP README.md
1
+# react-native-fetch-blob [![npm version](https://img.shields.io/badge/npm package-0.5.3-brightgreen.svg)](https://badge.fury.io/js/react-native-fetch-blob) ![](https://img.shields.io/badge/PR-Welcome-brightgreen.svg) ![](https://img.shields.io/badge/in progress-0.6.0-yellow.svg)
4
 
2
 
5
 A module provides upload, download, and files access API. Supports file stream read/write for process large files.
3
 A module provides upload, download, and files access API. Supports file stream read/write for process large files.
6
 
4
 
28
  * [File access](#user-content-file-access)
26
  * [File access](#user-content-file-access)
29
  * [File stream](#user-content-file-stream)
27
  * [File stream](#user-content-file-stream)
30
  * [Manage cached files](#user-content-manage-cached-files)
28
  * [Manage cached files](#user-content-manage-cached-files)
29
+ * [Self-Signed SSL Server](#user-content-selfsigned-ssl-server)
31
 * [API](#user-content-api)
30
 * [API](#user-content-api)
32
  * [config](#user-content-configoptionsrnfetchblobconfigfetch)
31
  * [config](#user-content-configoptionsrnfetchblobconfigfetch)
33
  * [fetch](#user-content-fetchmethod-url-headers-bodypromisefetchblobresponse)
32
  * [fetch](#user-content-fetchmethod-url-headers-bodypromisefetchblobresponse)
305
 
304
 
306
 #### Android Media Scanner, and Download Manager Support
305
 #### Android Media Scanner, and Download Manager Support
307
 
306
 
308
-If you want to make a file in `External Storage` becomes visible in Picture, Downloads, or other built-in apps, you will have to use `Media Scanner` or `Download Manager`. 
307
+If you want to make a file in `External Storage` becomes visible in Picture, Downloads, or other built-in apps, you will have to use `Media Scanner` or `Download Manager`.
309
 
308
 
310
 **Media Scanner**
309
 **Media Scanner**
311
 
310
 
336
 RNFetchBlob
335
 RNFetchBlob
337
     .config({
336
     .config({
338
         // Optional, if not specified, the file will download to system default path
337
         // Optional, if not specified, the file will download to system default path
339
-        path : DOWNLOAD_DEST, 
338
+        path : DOWNLOAD_DEST,
340
         addAdnroidDownloads : {
339
         addAdnroidDownloads : {
341
             useDownloadManager : true, // <-- this is the only thing required
340
             useDownloadManager : true, // <-- this is the only thing required
342
             // Optional, override notification setting (default to true)
341
             // Optional, override notification setting (default to true)
343
             notification : false,
342
             notification : false,
344
-            // Optional, but recommended since android DownloadManager will fail when 
343
+            // Optional, but recommended since android DownloadManager will fail when
345
             // the url does not contains a file extension, by default the mime type will be text/plain
344
             // the url does not contains a file extension, by default the mime type will be text/plain
346
             mime : 'text/plain',
345
             mime : 'text/plain',
347
             description : 'File downloaded by download manager.'
346
             description : 'File downloaded by download manager.'
508
 
507
 
509
 ```
508
 ```
510
 
509
 
510
+#### Self-Signed SSL Server
511
+
512
+By default, react-native-fetch-blob does NOT allow connection to unknown certification provider since it's dangerous. If you're going to connect a server with self-signed certification, add `trusty` to `config`. This function is available for version >= `0.5.3`
513
+
514
+```js
515
+RNFetchBlob.config({
516
+  trusty : true
517
+})
518
+.then('GET', 'https://mysite.com')
519
+.then((resp) => {
520
+  // ...
521
+})
522
+```
523
+
511
 ---
524
 ---
512
 
525
 
513
 ## API
526
 ## API
783
 
796
 
784
 A set of configurations that will be injected into a `fetch` method, with the following properties.
797
 A set of configurations that will be injected into a `fetch` method, with the following properties.
785
 
798
 
799
+#### trusty:boolean
800
+  `0.5.3`
801
+  Set this property to `true` will allow the request create connection with server have self-signed SSL certification. This is not recommended to use in production.
802
+
786
 #### fileCache:boolean
803
 #### fileCache:boolean
787
   Set this property to `true` will makes response data of the `fetch` stored in a temp file, by default the temp file will stored in App's own root folder with file name template `RNFetchBlob_tmp${timestamp}`.
804
   Set this property to `true` will makes response data of the `fetch` stored in a temp file, by default the temp file will stored in App's own root folder with file name template `RNFetchBlob_tmp${timestamp}`.
788
 #### appendExt:string
805
 #### appendExt:string
789
-  Set this propery to change temp file extension that created by `fetch` response data.
806
+  Set this property to change temp file extension that created by `fetch` response data.
790
 #### path:string
807
 #### path:string
791
   When this property has value, `fetch` API will try to store response data in the path ignoring `fileCache` and `appendExt` property.
808
   When this property has value, `fetch` API will try to store response data in the path ignoring `fileCache` and `appendExt` property.
792
 #### addAndroidDownloads:object (Android only)
809
 #### addAndroidDownloads:object (Android only)
854
 
871
 
855
 | Version | |
872
 | Version | |
856
 |---|---|
873
 |---|---|
874
+| 0.5.3 | Add API for access untrusted SSL server |
857
 | 0.5.2 | Fix improper url params bug [#26](https://github.com/wkh237/react-native-fetch-blob/issues/26) and change IOS HTTP implementation from NSURLConnection to NSURLSession |
875
 | 0.5.2 | Fix improper url params bug [#26](https://github.com/wkh237/react-native-fetch-blob/issues/26) and change IOS HTTP implementation from NSURLConnection to NSURLSession |
858
 | 0.5.0 | Upload/download with direct access to file storage, and also added file access APIs |
876
 | 0.5.0 | Upload/download with direct access to file storage, and also added file access APIs |
859
 | 0.4.2 | Supports upload/download progress |
877
 | 0.4.2 | Supports upload/download progress |