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 a JSON error response template for AJAX requests #688

Open
sanand0 opened this issue Jan 22, 2023 · 0 comments
Open

Add a JSON error response template for AJAX requests #688

sanand0 opened this issue Jan 22, 2023 · 0 comments
Assignees
Labels
data-api Features associated with REST, SOAP etc

Comments

@sanand0
Copy link
Contributor

sanand0 commented Jan 22, 2023

AJAX requests typically request a JSON response. The default Gramex error template is HTML. This makes parsing the response hard.

Provide an error response (template?) that makes this easy.

  • Maybe look at the Accept: header and serve JSON
  • Maybe serve JSON based on whether it was AJAX or direct
  • Maybe look at _format for FormHandler, and handle it accordingly
@sanand0 sanand0 added the data-api Features associated with REST, SOAP etc label Jan 22, 2023
@sanand0 sanand0 self-assigned this Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data-api Features associated with REST, SOAP etc
Projects
None yet
Development

No branches or pull requests

1 participant