2020-12-05 최초등록 |
[Sample]
- raw : test-tam.pe.kr/daum_search.php
- react+php : test-tam.pe.kr/fetch-data
[Code]
<?php
$url = "https://dapi.kakao.com/v2/search/web?query=test";
$REST_API_KEY = "444444444444444444444444444444444444";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$header = "KakaoAK ".$REST_API_KEY;
$headers = array();
$headers[] = "Authorization: ".$header;
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$res = curl_exec ($ch);
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close ($ch);
var_dump($res); // Kakao API 서버로 부터 받아온 값
?>
[Reference]
[Infomation]
'카카오 REST API & SDK > Daum 검색' 카테고리의 다른 글
Daum검색-웹문서검색 ajax로 간단히 테스트 해보기 (0) | 2021.06.03 |
---|
댓글