| Page 1 of 1 | [ 3 posts ] |
|
Not sure why but I seem to be unable to set the accept header when doing a form post with the connection manager.
The following code snipet always sents with the accept header of "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" so when the browser gets a document back with the content type of application/json it prompts the user. If I don't set the content type on the server the code works as expected. Code: var C = YAHOO.util.Connect; C.setForm(ul_form, true); var post_url = '/browser/json_upload_thumbnail/'+asset_path; C.initHeader("Accept", "application/json"); var d = C.asyncRequest('POST', post_url, callback); |
|
The parameters passed to setForm() indicate a file upload operation. In this mode, the request and response are facilitated through an iframe. If the response Content-Type is not set to some variation of "text/*", or if the Content-Type is not mapped to an application handler, it will throw the dialog to prompt for user action.
Regards, Thomas |
|
Ah OK thanks, that works for me.
|
| Page 1 of 1 | [ 3 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group