Skip to content
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

Added class to URLs in the response #322

Merged
merged 9 commits into from
Apr 24, 2019
27 changes: 23 additions & 4 deletions htsget.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ The server SHOULD reply with an `UnsupportedFormat` error if the requested forma
[^a]
</td></tr>
<tr markdown="block"><td>
`class`
_optional string_
</td><td>
Allows clients to request the data header only, using `class=header`. It is not possible to return the data body only, because that would not constitute a valid response in any of the supported formats.
Default: all
</td></tr>
<tr markdown="block"><td>
`referenceName`
_optional_
</td><td>
Expand Down Expand Up @@ -280,6 +287,14 @@ _optional object_
</td><td>
For HTTPS URLs, the server may supply a JSON object containing one or more string key-value pairs which the client MUST supply as headers with any request to the URL. For example, if headers is `{"Range": "bytes=0-1023", "Authorization": "Bearer xxxx"}`, then the client must supply the headers `Range: bytes=0-1023` and `Authorization: Bearer xxxx` with the HTTPS request to the URL.
</td></tr>
<tr markdown="block"><td>
`class`
_string_
</td><td>
For file formats whose specification describes a header and a body, the class indicates which of the two will be retrieved when querying this URL. The allowed values are `header` and `body`.

Either all or none of the URLs in the response MUST have a class attribute. If it is absent, clients should assume data blocks include both header and body, possibly mixed in one of the blocks.
</td></tr>
</table>

</td></tr>
Expand All @@ -300,24 +315,28 @@ An example of a JSON response is:
"format" : "BAM",
"urls" : [
{
"url" : "data:application/vnd.ga4gh.bam;base64,QkFNAQ=="
"url" : "data:application/vnd.ga4gh.bam;base64,QkFNAQ==",
"class" : "header"
},
{
"url" : "https://htsget.blocksrv.example/sample1234/header"
"url" : "https://htsget.blocksrv.example/sample1234/header",
"class" : "header"
},
{
"url" : "https://htsget.blocksrv.example/sample1234/run1.bam",
"headers" : {
"Authorization" : "Bearer xxxx",
"Range" : "bytes=65536-1003750"
}
},
"class" : "body"
},
{
"url" : "https://htsget.blocksrv.example/sample1234/run1.bam",
"headers" : {
"Authorization" : "Bearer xxxx",
"Range" : "bytes=2744831-9375732"
}
},
"class" : "body"
}
]
}
Expand Down