LoginSignup
1
1

More than 3 years have passed since last update.

GitHub Markdown APIの使い方

Last updated at Posted at 2019-09-14

リクエストURL

https://api.github.com/markdown/raw

ヘッダ

ヘッダ
Content-Type text/plain

あとはデータにマークダウンを渡してPOSTするだけ。

curlを使った例

curl -X POST https://api.github.com/markdown/raw -H 'Content-Type: text/plain' -d '# Hello World'
# => <h1>
#    <a id="user-content-hello-world" class="anchor" href="#hello-world" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Hello World</h1>

Golangを使った例

【Go】GitHub Markdown APIを叩いてみる - Qiita

おわりに

データをJSON形式で渡してオプションを指定する方法もあるけど、正直上記のもので十分なので今回は割愛。
知りたい方は下記参考リンクを参照。

参考

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1