通过curl发送GET和POST请求

通过curl发送GET和POST请求

问题描述:

是否可以通过linux终端使用curl发送GET和POST请求?通过curl发送GET和POST请求

本质上,我想了解这些人在本教程中做了些什么,但我不明白如何将其他GET参数添加到他们的教程示例中。

例如,在他们的教程(http://valeriobasile.github.io/candcapi/),他们使用的例子:

curl -d 'Every man loves a woman' 'http://gingerbeard.alwaysdata.net/candcapi/proxy.php/raw/pipeline?semantics=fol' 

它的工作原理,但我想这样的图形表示。他们还在他们的示例Here中提到了这一点。

"An entry point to generate a PNG image... 

$CANDCAPT/drg 

"The URL accepts the same GET parameter as pipeline." 

于是,我就派这一点,但它并没有得到一个PNG文件:

curl -d 'Every man loves a woman&pipeline' 'http://gingerbeard.alwaysdata.net/candcapi/proxy.php/raw/pipeline?semantics=drs&roles=verbnet' 

这实际上打破了他们的系统。

curl -d 'Every man loves a woman' 'http://gingerbeard.alwaysdata.net/candcapi/proxy.php/raw/pipeline?semantics=drs&roles=verbnet%20%@d%2dbox' 

所以我的问题是,我也不太知道什么是开发人员时,他们说的网址接受相同的GET参数的意思是,我将如何补充一点吗?请让我知道,如果你有任何想法,谢谢。

编辑1 -

我尝试添加DRG的替代管道,但它返回一个消息说,“未找到”

curl -d 'Every man loves a woman' 'http://gingerbeard.alwaysdata.net/candcapi/proxy.php/drg?semantics=fol' 

我在GitHub上的文档阅读,并在底部还介绍了如何以获得图形输出:

与c & C /义和拳API提供的入口点,以产生一个给定的文本的DRG的PNG图像:

$ CANDCAPI/drg

URL接受与管道相同的GET参数并返回原始PNG文件。

在此基础上,你的GET网址应该是这个样子:

http://gingerbeard.alwaysdata.net/candcapi/proxy.php/drg?semantics=fol 

使用“相同的” GET参数意味着,无论你传递给pipeline问号后,也可以传递给drg Web服务。

修改anwser:

下面是相同的例子正确的命令:

curl -d 'Every man loves a woman' 'http://gingerbeard.alwaysdata.net/candcapi/drg?semantics=fol' 

而对于人谁是初学者和我一样,这里的保存png文件:

curl -d 'Every man loves a woman' 'http://gingerbeard.alwaysdata.net/candcapi/drg?semantics=fol' >> image.png 
+0

第一,非常感谢你对我的帮助,这让我疯狂!其次,对此感到遗憾,我做了编辑,但无济于事。我会继续修补它,但它看起来不太好。:( – rj2700

+1

等等,这对我有用,哇!非常感谢! – rj2700