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

Support handling of multiple media types in Accept HTTP header #84

Open
m1h43l opened this issue Jul 31, 2020 · 0 comments
Open

Support handling of multiple media types in Accept HTTP header #84

m1h43l opened this issue Jul 31, 2020 · 0 comments

Comments

@m1h43l
Copy link
Collaborator

m1h43l commented Jul 31, 2020

Currently you can just retrieve the value of the Accept header. But the header can have multiple values like

application/json,application/xml,text/plain

or even with a priority

application/json,application/xml;q=0.6,text/plain;q=0.8

So some extra procedures for handling different media types would be great.

pointer il_getAcceptedMediaTypes(request); The returned pointer could be a simple list instance which is already in the project. We would just need to expose the list API by adding them to the binder source of the ILEastic service program.

varchar il_getPreferredAcceptedMediaType(request); This would return the accept http header with the highest priority. Could return / if none was provided.

varchar il_isMediaTypeAccepted(request : 'application/json' : ... : 'application/xml'); This would return the media type which ranks the highest in the list of accepted media types. As RPG cannot do variable number of parameter we would need to limit them to a fixed number and declare them as *nopass.

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

No branches or pull requests

1 participant