本文介绍了如何在javascript中使用Curl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在编写一个Chrome扩展,我想用Curl来获取gmail附件的下载链接。我应该怎么做?我是新来的卷曲,我不知道如何能够在JavaScript中使用卷曲库?
不要直接在Javascript中使用cURL。尽管你可以做AJAX。因此,一种解决方案是设置一个php脚本,您可以使用它从gmail获取链接。编辑:有一个实现 cURL在javascript 。检查一下。I am writing a chrome extension and I want to use Curl to get me the download links of the gmail attachments. How should i do it? I am new to curl and i don't know how would i able to use the curl library in javascript ?
解决方案
You can't use cURL directly in Javascript. You can do AJAX though. So one solution would be to setup a php script somewhere that you can use for getting links from gmail.
EDIT: There is an implementation of cURL in javascript here. Check it out.
这篇关于如何在javascript中使用Curl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!