Created
March 2, 2022 05:20
-
-
Save vanduc1102/9a629f6807b171c35f618a310087cef0 to your computer and use it in GitHub Desktop.
How to upload file to PreSignedUrl with vscode REST Client
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@baseUrl = {{$dotenv SERVICE_API_ENDPOINT}} | |
@accessToken = {{$dotenv SERVICE_API_ACCESS_TOKEN}} | |
### Health-check | |
GET {{baseUrl}}/health | |
### Media | |
### Create media upload url | |
## This endpoint return a JSON { data : "signedUrl" } | |
# @name generateMedia | |
POST {{baseUrl}}/api/v1/medias/ | |
content-type: application/json | |
Authorization: Bearer {{accessToken}} | |
{ | |
"fileName":"{{$guid}}", | |
"contentType": "image/jpeg" | |
} | |
### | |
@signedUploadUrl = {{generateMedia.response.body.data}} | |
PUT {{signedUploadUrl}} | |
Content-Type: image/jpeg | |
< /Users/duc.nguyen/Downloads/marra-_Gnbso4pl7M-unsplash.jpeg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment