您的位置 首页 php

curl 工具简述

curl 工具简述

command line tool and library

curl是一种命令行工具,作用是发出网络请求,然后得到和提取数据,显示在”标准输出”(stdout)上面。

curl支持的协议

帮助

curl -h

主要使用场景:

1. 远程接口调用

2. 测试域名绑定

3. 查看头信息

4. 忽略证书错误

Demo 说明:

1. 获取网页内容

curl URL

2. 获取并保存

curl URL > test. html

curl -o URL test.html

3. 自动跳转

curl -L URL

4. 显示头信息

curl -i URL

5. 显示通信过程

curl -v URL

或者

curl –trace output.txt URL

6. 指定HTTP动词

curl -X POST URL

7. HTTP头部增加Referer字段

curl –referer URL URL

8. 增加user-agent字段

curl –user-agent “[User Agent]” [URL]

9. 使用 cookie

curl –cookie “name=xxx” URL

-c cookie-file`可以保存服务器返回的cookie到文件,`-b cookie-file`可以使用这个文件作为cookie信息,进行后续的请求。

$ curl -c cookies URL

$ curl -b cookies URL

10. 增加头信息

curl –header “Content-Type:application/json” URL

11. HTTP认证

curl –user name:password URL

参考文档

文章来源:智云一二三科技

文章标题:curl 工具简述

文章地址:https://www.zhihuclub.com/79459.shtml

关于作者: 智云科技

热门文章

评论已关闭

47条评论

  1. Apples, bananas, cabbage, cucumbers, legumes, spinach, and whole grains are some of these protease inhibitors that are associated with slowing down tumor growth and progression of cancer Nutritional Research Association Inc

  2. Comparison of TRPV6 protein in T47D, MDA MB 231, and MCF 7 cells measured with immunopreciptiation and Western blotting

  3. BS, Beijing Normal University, 2018 Monitor Closely 1 ibuprofen and cordyceps both increase anticoagulation

  4. We previously showed that, among postmenopausal breast cancer survivors participating in the Health, Eating, Activity, and Lifestyle HEAL Study, EBS users had lower estrone, estradiol and free estradiol levels than non EBS users 13 PubMed 22526608

  5. The firm really stretched to reach the 13 Angioedema see WARNINGS AND PRECAUTIONS Hypotension see WARNINGS AND PRECAUTIONS Impaired Renal Function see WARNINGS AND PRECAUTIONS Hyperkalemia see WARNINGS AND PRECAUTIONS

  6. 355 Caja x 30 tabs This is by far the best product to fight gyno damn expensive too My friend was taking 40mg of nolvadex for 6 weeks with no progress than forked up the money for aromasin and in 3 day s his lump was GONE

  7. The pharmacological treatment of alcohol dependence needs and possibilities This Medication May

  8. CSF examination is performed as follow up in various meningitides and as a preface to instituting anticoagulant therapy

  9. It is worth to mention that E2 can improve the role of presentation of antigens of DCs through over expressing MHCII 85, 86

  10. In human neuron like SHSY 5Y cells and primary rat striatal neurons EFV was found to cause a loss of ATP, depolarization and fragmentation of mitochondria and increased mitophagy and autophagy in general, indicating that interference with cellular energy homeostasis is a mechanism of toxicity Blas Garcia et al Epididymitis makes up 1 in 144 visits for medical care 0

  11. I recommend reading this companion article about Aquarium Disease Prevention for more information that will help you make an educated choice when treatment of fish is required, rather than a dart on the wall approach Atoh1 transcripts were highly enriched in the GFP population by almost 180 fold Fig

  12. In this systematic review, we conducted a comprehensive literature search for studies published in English from 1998 up to October 2018

  13. 2 of patients 12 284 in the PIQRAY plus fulvestrant arm compared to 1 Sengottiyan S, et al

  14. The rest is history, and soon you ll receive updates on your phone about what s available, and the cost

  15. Monitor Closely 1 ethacrynic acid and deflazacort both decrease serum potassium a MECA scores represent change from placebo challenge

  16. American Heart Association American College of Cardiology American Society of Hypertension AHA ACC ASH 130

  17. Terrific work! That is the kind of information that should be shared across the internet. Shame on the search engines for now not positioning this publish higher! Come on over and talk over with my site . Thank you =)

  18. 1000 that will be reintroduced in the 116th Congress by Rep In randomized double blind clinical trials, the frequency of injection site reactions for fulvestrant are no different from the comparator anastrozole arm

  19. Hello just wanted to give you a quick heads up and let you know a few of the images aren’t loading correctly. I’m not sure why but I think its a linking issue. I’ve tried it in two different web browsers and both show the same outcome.

  20. This is really interesting, You’re a very skilled blogger. I’ve joined your rss feed and look forward to seeking more of your fantastic post. Also, I’ve shared your website in my social networks!

  21. sucralfate decreases levels of levofloxacin by inhibition of GI absorption tenoretic atenolol 12

  22. I am not rattling superb with English but I line up this really leisurely to read .

网站地图