답변 1개
채택된 답변
+20 포인트
2년 전
API 면 curl 로 보낼것 같은데요...
보낼 파리미터를
</p>
<p>$url = '<a href="https://www.dasfdfasdf.com/api';" target="_blank" rel="noopener noreferrer">https://www.dasfdfasdf.com/api';</a>
$headers = array('Content-Type: application/json', 'Authorization: key='.$TOKEN_KEY);</p>
<p>$body => array(
'title' => $title,
'uri' =>$link,
'text' => $text,
'image' => $img,
'color' => '#32ac03'
);</p>
<p>$data = json_encode($body);</p>
<p>$ch = curl_init ();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);</p>
<p>$result = curl_exec($ch);
curl_close($ch);</p>
<p>
위와 같이 하고 필요한 부분은 맞게 수정해서 해보세요
만약 GET 방식으로 링크로 보내는 것이라면 다르게해야 할 것입니다.
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
p
ploki0911
2년 전
이게 뭐에용?? 티스토리 api 로 보내는건가요?
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인