你如何制作和使用POST URL?

时间:2014-09-05 05:07:40

标签: url post http-post slack-api

我目前正在搞乱Slack集成(https://slack.com/integrations),并试图自己制作一个。我知道当我的命令被命中时,它会将这样的东西发布到URL:

 token=whatever
 team_id=12345
 channel_id=ABC123
 channel_name=test
 timestamp=1355517523.000005
 user_id=USER123
 user_name=Steve
 text=googlebot: What is the air-speed velocity of an unladen swallow?
 trigger_word=googlebot:

我理解这在概念上如何运作,但我以前从未实际使用过POST。

我们只想说我想把这些数据放在Google电子表格或网页上。 POST URL实际上包含什么?我可以将静态URL链接到GitHub上的文件吗?我是否必须使用像PHP这样的东西,或者JavaScript?我如何实际接受这个输入?

非常感谢你的帮助!

1 个答案:

答案 0 :(得分:2)

要发帖,您需要一个浏览器扩展程序,例如Postman:

https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm?hl=en

或者您可以使用HTML表单提交

http://www.w3schools.com/tags/att_form_method.asp

或Javascript AJAX请求

http://www.w3schools.com/jquery/jquery_ajax_get_post.asp

最后,您可以使用以下命令在命令行上执行:

curl -X POST http://example.com/test -d'postdatahere'