🚀 Add Ability to send HTTP code with send_ajax_response #4108
dougblackjr
started this conversation in
Feature Requests
Replies: 3 comments
-
|
@dougblackjr excellent idea! I think it's not necessary to add third parameter, we can add a check whether 2nd parameter is a boolean or a 3-digit number |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
@intoeetive Nice! I'll get to work on a PR |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
@intoeetive Added a PR here: #4110 I can't add labels or anything, let me know if I need to do anything else on this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Suggest an idea for ExpressionEngine
Is your feature request related to a problem? Please describe.
As I'm using EE to build some API functionality related to other 3rd party apps, I am finding I need to add certain HTTP codes (particularly 201, 400, 403) for ajax responses. Currently, the
send_ajax_responsefunction in the Output library only allows for the data and whether to send as an error (500) or success (200).Describe the solution you'd like
Would like to see the ability to set the HTTP code in that function.
Describe alternatives you've considered
Right now, I'm accomplishing the same with setting the header and echoing the response. Far from ideal.
Teachability, Documentation, Adoption, Migration Strategy
I envision changing this function to look like this:
I'm still not sure this is the best route, so I'd love input. I am a bit concerned about backwards compatibility.
Beta Was this translation helpful? Give feedback.
All reactions