Bug Tracker

Modify

Ticket #2639 (closed enhancement: wontfix)

Opened 5 years ago

Last modified 5 years ago

Make XMLHttpRequest or headersAvailable to "success" callback of post

Reported by: Shaft0rz Owned by:
Priority: major Milestone: 1.2.4
Component: ajax Version: 1.2.3
Keywords: post header Cc:
Blocking: Blocked by:

Description

I would like to be able to check the Response headers of a $.post() call in the success callback. In my case, the response might either be text, or json, and I'd like to vary my behavior based on the Content-Type. I believe I can work around it with the ajaxSuccess event, but I think a more direct solution would be helpful.

Attachments

detect_content_type.diff Download (744 bytes) - added by Shaft0rz 5 years ago.
diff that implements auto content-type detection

Change History

Changed 5 years ago by Shaft0rz

diff that implements auto content-type detection

comment:1 Changed 5 years ago by Shaft0rz

I've attached a patch that works-around my request, but taking the appropriate action in httpData based on the content-type (only if the user hasn't specified a content-type).

comment:2 Changed 5 years ago by flesler

  • Status changed from new to closed
  • Resolution set to wontfix

Use the 'complete' callback, it does receive the XMLHttpRequest object.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.