나는 오픈 서치와 Atom 피드를 구축 INSPIRE의 다운로드 서비스에 대한 공식 기술 가이드를 다음 봤는데 : https://inspire.ec.europa.eu/documents/technical-guidance-implementation-inspire-download-servicesOpenSearch + PHP for INSPIRE ATOM : 왜 올바른 Content-Type을 얻을 수 있습니까?
내가 검색을 수행하는 PHP
를 생성에 붙어있어.
은 앞서 언급 한 가이드에 따르면, 오픈 서치 설명 XML은 이러한 템플릿을 가지고 있습니다
같은 가이드는 개발자가 "search.php"파일을 작성하는 데 도움 수있는 PHP
스크립트가 있습니다. 이 스크립트는 다음과 같이 시작됩니다.
$returnFile = false;
foreach (apache_request_headers() as $name => $value) {
//echo("$name: $value\n");
if ($name=="Accept" && $value=="application/zip"){
$returnFile = true;
}
}
$returnFile
이 참이면 ZIP 파일을 반환해야합니다. false 인 경우 XML이 반환됩니다 (즉, 나머지 스크립트가 수행하는 것입니다).
내 문제는 조건 $name=="Accept" && $value=="application/zip"
이 절대로 사실이 아니므로 검색에서 항상 XML을 반환한다는 것입니다.
$value
은 application/zip
이 될 수 있습니까?
이
은http://myWeb/atom/search.php
에 액세스 할 때 내가 얻을
Accept
값입니다 :
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
편집 : 나는 내 ATOM 피드를 테스트하는 경우,
The example given in Annex A uses content negotiation to identify which
operation to perform. This means that even though the operation endpoint is
only one, i.e. http://myWeb/search.php, the client has to set the HTTP
―Accept‖ Header to the correct value in order to receive the expected
result.
그래서 : 가이드는 이것에 대해 더 많은 것을 알려줍니다 INSPIRE 유효성 검사기에서 클라이언트는 INSPIRE 유효성 검사기 (search.php에 쿼리를 보내는 인증 자)입니다 ... 제가 틀 렸습니다?