Merge pull request #12946 from Kovensky/patch-3

Axios: give an index type to response headers
This commit is contained in:
Paul van Brenk
2016-11-30 10:59:56 -08:00
committed by GitHub
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -80,7 +80,11 @@ var axiosInstance = axios.create({
timeout: 1000
});
axiosInstance.request({url: "issues/1"});
axiosInstance.request({url: "issues/1"}).then(res => {
if (res.headers['content-type'].startsWith('application/json')) {
throw new Error('Unexpected content-type');
}
});
axios.all<Repository, Repository>([getRepoDetails, getRepoDetails]).then(([repo1, repo2]) => {
var sumIds = repo1.data.id + repo2.data.id;
+1 -1
View File
@@ -159,7 +159,7 @@ declare namespace Axios {
/**
* headers that the server responded with
*/
headers: Object;
headers: {[index: string]: any};
/**
* config that was provided to `axios` for the request