Warm tip: This article is reproduced from serverfault.com, please click

其他-Schema.org无法交付application / ld + json

(其他 - Schema.org fails to deliver application/ld+json)

发布于 2020-12-17 08:00:04

在我的Java应用程序中,出现以下错误

Caused by: java.lang.RuntimeException: java.lang.RuntimeException:   
com.github.jsonldjava.core.JsonLdError: loading remote context failed: http://schema.org/

随着卷曲我目前得到的东西像

curl -i -L -k --compressed -H "Accept: application/ld+json" https://schema.org/
HTTP/2 200 
access-control-allow-credentials: true
access-control-allow-headers: Accept
access-control-allow-methods: GET
access-control-allow-origin: *
access-control-expose-headers: Link
link: </docs/jsonldcontext.jsonld>; rel="alternate"; type="application/ld+json"
....
/**   Body contains HTML payload **/
Questioner
jschnasse
Viewed
0
jschnasse 2021-02-10 20:56:29

主页不再支持内容协商。相反,你必须按照以下说明进行操作

https://schema.org/docs/developers.html

并使用以下链接版本之一:

例如

https://schema.org/version/latest/schemaorg-current-http.jsonld

{
    "@context" : "https://schema.org/version/latest/schemaorg-current-http.jsonld"
}

或卷曲

curl -i -L https://schema.org/version/latest/schemaorg-current-http.jsonld