Setting the Accept request header on Upload control

4 posts, 0 answers
  1. Ryan
    Ryan avatar
    7 posts
    Member since:
    Aug 2012

    Posted 27 Aug 2012 Link to this post

    The default HTTP Accept request header used by the Upload control appears to be: "text/html,application/xhtml+xml,application/xml". I'd like to be able to set that to "application/json" instead. Is that possible?


    -Ryan
  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 29 Aug 2012 Link to this post

    Hello,

    I'm posting the reply to your ticket for community reference.

    The Accept header can't be set in browsers that do not support the HTML5 File API.

    If the WebAPI service is in your control you might get away by replacing the content negotiator with your own. This will allow you to use a query string parameter to select the response type.

    Kind regards,
    Tsvetomir Tsonev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 11 Jul 2014 in reply to T. Tsonev Link to this post

    I know this is an old post, but is there a full example of using the upload with WebAPI? 
  5. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2159 posts

    Posted 16 Jul 2014 Link to this post

    Hello Dan,


    You could take a look at the attached project, which demonstrates a sample implementation of Kendo UI Upload with WebAPI.

    I wish you a great day!

    Regards,
    Dimiter Madjarov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready