我一直在尝试获取 pastebin API,而不是告诉我 pastebin 链接,只输出原始数据。PHP代码是这样的:
<?php
$api_dev_key = 'Stackoverflow(fake key)';
$api_paste_code = 'API.'; // your paste text
$api_paste_private = '1'; // 0=public 1=unlisted 2=private
$api_paste_expire_date = 'N';
$api_paste_format = 'php';
$api_paste_code = urlencode($api_paste_code);
$url = 'http://pastebin.com/api/api_post.php';
$ch = curl_init($url);
?>
通常这会将 $api_paste_code 上传到 pastebin ,显示为 pastebin.com/St4ck0v3RFL0W ,但我希望它生成原始数据。
原始数据链接是http://pastebin.com/raw.php?i= ,有人可以帮忙吗?
参考: http: //pastebin.com/api