How To Pass Headers From WebApi To AngularJS Of $http.get(...).then(function(result){..})

Posted by Kasani007 under AngularJS 1x on 11/1/2017 | Points: 10 | Views : 755 | Status : [Member] | Replies : 2
I Used the below but, it shows error
$http.get(...).success is not a function

I Used $http.get(...).then, it worked fine, but the headers send from webapi using httpresponsemessage result is not showing in .then(function(response){

})
when i used
httpResponseMessage.Content = new ByteArrayContent(bytes.ToArray());
httpResponseMessage.Content.Headers.Add("x-filename", fileName);
httpResponseMessage.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
httpResponseMessage.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment");
httpResponseMessage.Content.Headers.ContentDisposition.FileName = fileName;

Please help me how can i pass headers(filename, contenttype..etc) from webapi to angularjs $http.get(...).then(function(result){..})

Thanks In Advance




Responses

Posted by: Amesraay on: 2/6/2018 [Member] Starter | Points: 25

Up
0
Down
terrariumtv.mobi is the most trusted website to download the apk file for free cost.

Kasani007, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Mikeshean11 on: 3/25/2018 [Member] Starter | Points: 25

Up
0
Down
watch online movies and tv shows on your Android smartphone, download https://downloadterrariumtvapp.com/download-terrarium-tv-apk/ and start watching now. You can also download https://downloadterrariumtvapp.com/terrarium-tv-pc-laptop/ to stream movies on laptop or pc.

Kasani007, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response