mirror of https://github.com/helloxz/MDtoHTML
del
parent
5b25826cb5
commit
5c3e817e12
|
@ -3,7 +3,7 @@
|
|||
|
||||
### 使用
|
||||
* 获取一个可以访问的markdown文件地址,比如`http://soft.xiaoz.org/readme.md`
|
||||
* 然后访问[https://markdown.win/api.php?url=http://soft.xiaoz.org/readme.md](https://markdown.win/api.php?url=http://soft.xiaoz.org/readme.md "https://markdown.win/api.php?url=http://soft.xiaoz.org/readme.md") 试试效果。
|
||||
* 然后访问 [https://markdown.win/api.php?url=http://soft.xiaoz.org/readme.md](https://markdown.win/api.php?url=http://soft.xiaoz.org/readme.md "https://markdown.win/api.php?url=http://soft.xiaoz.org/readme.md") 试试效果。
|
||||
* API说明请参考 [https://doc.xiaoz.me/](https://doc.xiaoz.me/docs/api/mdtohtml-api)
|
||||
|
||||
### 演示地址
|
||||
|
|
21
index.html
21
index.html
|
@ -1,21 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh-cmn-Hans" xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>MDtoHTML</title>
|
||||
<meta name="generator" content="EverEdit" />
|
||||
<meta name="author" content="" />
|
||||
<meta name="keywords" content="" />
|
||||
<meta name="description" content="" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="mdtohtml"></div>
|
||||
<script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
|
||||
<script src="https://cdn.bootcss.com/highlight.js/9.12.0/highlight.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#mdtohtml").load("http://markdown.win/api.php?url=http://markdown.win/README.md");
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
57
test.md
57
test.md
|
@ -1,57 +0,0 @@
|
|||
### GET方式
|
||||
```php
|
||||
<?php
|
||||
//初始化
|
||||
$ch = curl_init();
|
||||
//设置选项,包括URL
|
||||
curl_setopt($ch, CURLOPT_URL, "http://www.jb51.net");
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
//执行并获取HTML文档内容
|
||||
$output = curl_exec($ch);
|
||||
//释放curl句柄
|
||||
curl_close($ch);
|
||||
//打印获得的数据
|
||||
print_r($output);
|
||||
?>
|
||||
```
|
||||
|
||||
### POST方式
|
||||
```
|
||||
<?php
|
||||
$url = "http://localhost/web_services.php";
|
||||
$post_data = array ("username" => "bob","key" => "12345");
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
// post数据
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
// post的变量
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
|
||||
$output = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
//打印获得的数据
|
||||
print_r($output);
|
||||
?>
|
||||
```
|
||||
### HTTPS
|
||||
```
|
||||
<?php
|
||||
$curl = curl_init("https://www.xiaoz.me/");
|
||||
|
||||
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)");
|
||||
curl_setopt($curl, CURLOPT_FAILONERROR, true);
|
||||
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
|
||||
|
||||
$html = curl_exec($curl);
|
||||
curl_close($curl);
|
||||
var_dump($html);
|
||||
?>
|
||||
```
|
||||
|
||||
___
|
||||
|
||||
> 测试是否删除了缓存
|
Loading…
Reference in New Issue