-
Notifications
You must be signed in to change notification settings - Fork 16
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
http_pengine_send does not accept application/json #15
Comments
No. It accepts |
TRIGGER WARNING - Java below!
// TODO can we abstract this?
|
/pengines/create accepts but /pengines/send does not. On the Java side I'm adding Accept: application/json and Content-Type: application/json headers I assumed this was me, of course, at first, but the code's pretty clear on the server side. I stepped into it. http handler calls http_pengine_send Second clause calls http_parameters, which is eventually going to call http_parms which calls form_data_content_type which in turn needs application/x-www-form-urlencoded http_pengine_create handles this differently
and is handled correctly. The code I'm using is essentially copy/paste from my create method. Java involves much typing. 8cO |
True. /pengine/send expects a Prolog event. Might not be a great id. See the web/js/pengines.js
The JavaScript client is probably the best documentation :) One route might be for you to complete the Java client, and before you start other ones, evaluate the oddities and possibly fix them. |
OK - thanks for advice about JS client. I haven't looked at it - I've been following the main and Pengines sites and tracing through the Prolog implementation. Are query strings allowed with POST ? RFC7231 is unclear on the subject, but I suspect it's buried somewhere. Obviously it's common to pass in body because that's what web forms do. Anyway, I'll change JavaPengines to do this, and submit a fix that lets it use JSON. |
And it won't respond with JSON either, even if the accept header is present it responds with raw Prolog. |
Again, see pengines.js:
I.e, it sends a `format' parameter. Not sure this is a good idea. Some of this is history :( |
Ah! Thought that was format TO server |
@Anniepoo Is there still a remaining issue here or can this be closed? |
leave open - its still true. having a workaround isnt a fix |
i expect to fix in next week or so |
http_pengine_create accepts application/json,
but POST requests to http_pengine_send only accept application/x-www-form-urlencoded
=8cO <-- Annie discovering this while implementing java client
The text was updated successfully, but these errors were encountered: