title: What should be dataType in ajax call for WebApi in C# returns HttpResponseMessage
body: <p>WebApi Resopnse in C#</p>
  
  <pre><code> public HttpResponseMessage DownloadFilesDirect(List&lt;string&gt; filesId)
      {
          var response = new HttpResponseMessage();
  
          //code to extract file
  
  
          if (filesList == null)
          {
              return response = new HttpResponseMessage(HttpStatusCode.Gone);
          }
          else
          {
              var file = filesList[0].File;
              response = new HttpResponseMessage(HttpStatusCode.OK);
              response.Content = new StreamContent(file.Open(FileMode.Open, FileAccess.Read));
              response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment");
              response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
              response.Content.Headers.ContentDisposition.FileName = file.Name;
          }
  
          return response;
      }
  </code></pre>
  
  <p>WebApi return HttpStatusCode.OK i.e. goes into else part of code</p>
  
  <p>Ajax call </p>
  
  <pre><code>$.ajax({
               url: urlforwebapi,
  
               type: CONST_HTTP_POST,
  
               //xhrFields: { withCredentials: true },
  
               contentType: "application/json; charset=utf-8",
  
               data: JSON.stringify(data),
  
               success: function (result) {
                   if (callback_success != undefined) callback_success(result);
               },
               error: function () {
                   if (callback_error != undefined) callback_error();
               }
           });
  </code></pre>
  
  <p>Web Api returns Correct reponse but ajax call return to error instead of success. help me resolve issue</p>
  
  <p>In ajax call -> I tried dataType with value = application/octet-stream but this is also not working.</p>