반응형
axios.get('https://example.com/getSomething', {
	headers: {
    	'Accept': 'application/json',
        'Authorization': 'asdf-123-sadf-234'
    }
})
.then((res) => {
	console.log(res.data);
 })
 .catch((error) => {
 	console.log(error)
 })

 

이를 curl로 호출하면 다음과 같다.

 

curl -X GET --header "Accept: application/json" --header "Authorization: asdf-123-sadf-234" "https://example.com/getSomething"

 

반응형