LD4P / sinopia_server

[Deprecated - switching to MongoDB] Sinopia Back-end CRUD Service. LDP-inspired, HTTP Server taking JSON-LD resources & administrative metadata.
Apache License 2.0
1 stars 1 forks source link

getResource takes caller-specified Accept header #85

Closed jmartin-sul closed 5 years ago

jmartin-sul commented 5 years ago

this allows the caller to ask for either RDF (application/ld+json) or non-RDF (application/json).

see tests for usage example.

closes #76

jmartin-sul commented 5 years ago

@mjgiarlo, good catch, thank you! yeah, cheat sheet docs w/ curl commands also use Accept. i think this was me just confusing Accept and Accept-Encoding.

um, yeah, not sure why that's working, but will fix to use Accept instead.

mjgiarlo commented 5 years ago

@mjgiarlo, good catch, thank you! yeah, cheat sheet docs w/ curl commands also use Accept. i think this was me just confusing Accept and Accept-Encoding.

OK!

um, yeah, not sure why that's working, but will fix to use Accept instead.

:alien: :alien:

jmartin-sul commented 5 years ago

ok @mjgiarlo, ready for review again, touched up the changes to use Accept instead of Accept-Encoding, added a couple examples, bumped the version.

(also the force-push diff link is one of my favorite new github features of the last few months, so handy)

jmartin-sul commented 5 years ago

@jgreben, i just published ~3.0.0-beta2~ 3.0.0-beta3 of the client to npm, could you see if the updated version of getResourceWithHttpInfo works for you? you'd want to invoke it like this:

instance.getResourceWithHttpInfo(groupId, slug, { accept: 'application/json' })

thanks!

mjgiarlo commented 5 years ago

@jmartin-sul :speech_balloon:

you'd want to invoke it like this:

instance.getResourceWithHttpInfo(groupId, slug, { acceptEncoding: 'application/json' })

acceptEncoding or accept?

jmartin-sul commented 5 years ago

@mjgiarlo: g)#@^^*t, yup, oversight, will fix 🙂

jmartin-sul commented 5 years ago

@mjgiarlo, ready for review once again

@jgreben, slight update to my earlier comment, correcting the param to be accept instead of acceptEncoding. e.g.:

instance.getResourceWithHttpInfo(groupId, slug, { accept: 'application/json' })
jmartin-sul commented 5 years ago

@jgreben, also, i just published 3.0.0-beta3 to npm

mjgiarlo commented 5 years ago

Did not merge bc @jgreben's review was requested.

jermnelson commented 5 years ago

LGTM, @jmartin-sul I can merge if you want me to.

jmartin-sul commented 5 years ago

@jermnelson, that'd be great, if you wouldn't mind. sounds like @jgreben is using the updated method successfully in the editor, which was primarily what i wanted his review for.

thanks!

mjgiarlo commented 5 years ago

@jermnelson @jmartin-sul got it!