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

add support for other HTTP methods #293

Closed
wants to merge 2 commits into from

Conversation

Conal-Tuohy
Copy link
Contributor

@Conal-Tuohy Conal-Tuohy commented Jun 18, 2019

Prompted by the recent updates to the XProc 3.0 issue about HTTP methods, where I argued that an XProc processor should support any method, I finally got around to the refactoring we discussed a while back, when I had quickly patched in HTTP PATCH.

I've added two inner classes to implement HTTP requests with a body, and without a body, which are used when the c:request/@method is not one of the specifically-handled methods like GET and PUT. If you supply a body, you get one of those classes; if you don't supply a body, you get the other.

I "flipped" the sanity check which used to ensure that you didn't supply a body along with a method which doesn't call for a body, so that it uses an "open world" assumption, and rejects only the cases which it knows are definitely in error, and otherwise (if the method is not known) it assumes that you know what you're doing.

The additional tests make HTTP OPTIONS requests, both with and without a body, and check that the server responds with 200 OK to both.

@Conal-Tuohy
Copy link
Contributor Author

@ndw, if you have a moment? I don't think this is at all controversial, and I'd love to see it accepted, so that I'm not continuing to use a fork of your codebase.

Also it would be great if you'd consider taking the same approach to dealing with unknown HTTP methods in the new version of Calabash.

ndw added a commit that referenced this pull request Oct 11, 2020
ndw added a commit that referenced this pull request Oct 11, 2020
@ndw
Copy link
Owner

ndw commented Oct 11, 2020

Applied to version 1.2.5 for Saxon 9.9 and Saxon 10.x

@ndw ndw closed this Oct 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants