fix: linguitic and header type changes

pull/362/head
louremipsum 2 years ago
parent 7159f05922
commit 2e6ca4a7bd

@ -1,7 +1,7 @@
![plugin-upload](banner.png) ![plugin-upload](banner.png)
Upload files from disk to a remote server over HTTP. Upload files from disk to a remote server over HTTP.
Download files from a remote HTTP server to disk Download files from a remote HTTP server to disk.
## Install ## Install
@ -55,10 +55,10 @@ Afterwards all the plugin's APIs are available through the JavaScript guest bind
import { upload } from 'tauri-plugin-upload-api' import { upload } from 'tauri-plugin-upload-api'
upload( upload(
'https://example.com/file-upload' 'https://example.com/file-upload',
'./path/to/my/file.txt' './path/to/my/file.txt',
(progress, total) => console.log(`Uploaded ${progress} of ${total} bytes`) // a callback that will be called with the upload progress (progress, total) => console.log(`Uploaded ${progress} of ${total} bytes`), // a callback that will be called with the upload progress
{ 'ContentType': 'text/plain' } // optional headers to send with the request { 'Content-Type': 'text/plain' } // optional headers to send with the request
) )
``` ```
@ -66,10 +66,10 @@ upload(
import { download } from "tauri-plugin-upload-api"; import { download } from "tauri-plugin-upload-api";
download( download(
'https://example.com/file-download-link' 'https://example.com/file-download-link',
'./path/to/save/my/file.txt' './path/to/save/my/file.txt',
(progress, total) => console.log(`Downloaded ${progress} of ${total} bytes`) // a callback that will be called with the download progress (progress, total) => console.log(`Downloaded ${progress} of ${total} bytes`), // a callback that will be called with the download progress
{ 'ContentType': 'text/plain' } // optional headers to send with the request { 'Content-Type': 'text/plain' } // optional headers to send with the request
) )
``` ```

Loading…
Cancel
Save