0

解决 DOI 后得到的结果取决于内容协商。我正在查看https://citation.crosscite.org/docs.html#sec-3 ,我看到不同的服务提供不同的内容类型。

对于一个特定的 URL,我想知道它可以给我的所有内容类型。其中一些可能比我所知道的更有用(即我不想提前写一个偏好列表)。

例如:

https://doi.org/10.5061/dryad.1r170

我想也许 OPTIONS 是这样做的方法

但这并没有带来什么有趣的东西,只是关于允许的请求方法。

shell> curl  -v -X OPTIONS   http://doi.org/10.5061/dryad.1r170
* Hostname was NOT found in DNS cache
*   Trying 2600:1f14:6cf:c01::d...
*   Trying 54.191.229.235...
* Connected to doi.org (2600:1f14:6cf:c01::d) port 80 (#0)
> OPTIONS /10.5061/dryad.1r170 HTTP/1.1
> User-Agent: curl/7.38.0
> Host: doi.org
> Accept: */*
>
< HTTP/1.1 200 OK
* Server Apache-Coyote/1.1 is not blacklisted
< Server: Apache-Coyote/1.1
< Allow: GET, HEAD, POST, TRACE, OPTIONS
< Content-Length: 0
< Date: Mon, 29 Jan 2018 07:01:14 GMT
<
* Connection #0 to host doi.org left intact
4

1 回答 1

0

我想目前还没有这样的标准,但是链接头:https ://www.w3.org/wiki/LinkHeader可以公开这些信息。

但就个人而言,我不会太依赖它。例如,服务器可以开始发送新的内容类型,但仍然不会通过此标头公开它。

通过手动或自动方式经常检查 API 响应标头是否有任何更改可能很有用。

于 2018-01-29T07:21:13.743 回答