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

Sparql\Client — fallback to autodetection of content-type #229

Open
indeyets opened this issue Jan 16, 2015 · 0 comments
Open

Sparql\Client — fallback to autodetection of content-type #229

indeyets opened this issue Jan 16, 2015 · 0 comments
Assignees

Comments

@indeyets
Copy link
Contributor

Currently, EasyRdf trusts server to give us a Content-type header corresponding to the body of request. That's good and logical, but some servers are not either good or logical :-D

We should switch to the following approach:

  1. If we recognize content-type, then try to parse document according to it
  2. if content-type is unrecognized or parser threw EasyRdf\Parser\Exception then use EasyRdf\Format::guessFormat to guess the format
  3. If guessing succeeds and guess is different from original format — try parser for the new format
  4. if guess fails or gives same format or if new parser fails — throw EasyRdf\Exception
@indeyets indeyets self-assigned this Jan 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant