How to use content-md5 header with curl for validating
we are trying to validate the downloaded files with file size for the response which is incorrect and suggested to use content-md5 header, but we are not aware of it. let us know how to use this.
Best Answer
-
The suggestion could be related to this advisory which is advised to retrieve the checksum and file size from the following HTTP header fields returned in the file download response:
- x-amz-meta-md5sum for the downloaded file’s MD5 checksum if you downloaded the file directly
from Amazon Web Services. - Content-MD5 for the downloaded file’s MD5 checksum if you downloaded from Tick History.
- Content-Length for the downloaded file’s size in octets (that is, in eight-bit bytes).
With regard to package delivery id, I understand that you download VBD files via /StandardExtractions/UserPackageDeliveries('<package delivery id')/$value endpoint. You can use curl with -I option to get only response's header. The MD5 checksum is in Content-MD5 header.
curl -I -Ls -H "Authorization: Token_xxx" -X GET "https://hosted.datascopeapi.reuters.com/RestApi/v1/StandardExtractions/UserPackageDeliveries('0x0634b9ef4aeb3026')/$value"
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 3471212
Content-Type: text/plain
Content-Encoding: gzip
Content-MD5: a6740f781a6289b145a59be91b0be6e3
Expires: -1
Accept-Ranges: bytes
Server: Microsoft-IIS/7.5
Content-Disposition: attachment; filename=CBT-2018-06-06-NORMALIZEDMP-Report-1-of-1.csv.gzOnce the file is downloaded, you can run md5sum command in Linux to get md5 checksum for the downloaded file and then compare the output with value in the Content-MD5 header.
#md5sum CBT-2018-06-06-NORMALIZEDMP-Report-1-of-1.csv.gz
#a6740f781a6289b145a59be91b0be6e3 CBT-2018-06-06-NORMALIZEDMP-Report-1-of-1.csv.gzHope this helps. If this is not what you are looking for, please elaborate.
0 - x-amz-meta-md5sum for the downloaded file’s MD5 checksum if you downloaded the file directly
Answers
-
@samara, we need a bit more info to answer:
- How are you requesting the data ? Is this a schedule created manually in the GUI, a schedule created using the API, or a custom (On Demand) request through the API ? If this query is not clear, please see this info on Scheduled vs On Demand.
- How are you downloading the files ? Manually from the GUI, or through the API ?
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 614 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 248 ETA
- 552 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 640 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 191 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛