Hongmu Notes
Home Summary of pitfalls curl post submission example
Summary of pitfalls

curl post submission example

curl post submission example
<?php
    $host = "/";
    $path = "/wyc/title";
    $method = "POST";
    $apikey = "你要调用API的apikey";
    $headers = array();
    array_push($headers, "Authorization:" . $apikey);
    //根据API的要求,定义相对应的Content-Type
    array_push($headers, "Content-Type".":"."application/x-www-form-urlencoded; charset=UTF-8");
    $querys = "";
    $bodys = "txt=txt";
    $url = $host . $path;
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($curl, CURLOPT_FAILONERROR, false);
    if (1 == strpos("$".$host, "https://"))
    {
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
    }
    curl_setopt($curl, CURLOPT_POSTFIELDS, $bodys);
    curl_exec($curl);
微信赞赏

WeChat

支付宝赞赏

Alipay

✍️ Author: Hong Mu

webmaster · Thanks for reading, stay tuned for more exciting content

Author homepage View home page →

Related articles

Browser caching increases the speed of secondary visits to your website

Browser caching increases the speed of secondary visits to your website Summary of pitfalls

Use browser caching of official words: If users will visit your website multiple times, browser caching of static resources can save users time. Cache headers should be applied to all cacheable static resources, not just to a small subset of static resources (for example, images). Cacheable resources include JS and CSS files, image files, and other binary object files (media files, PDF files, etc.). Normally, HTML doesn’t…
👁 202

Recommended reading

Website Development – Mini-Program Development & Website Templates – 0567

Website Development – Mini-Program Development & Website Templates – 0567 Practical Collection Yiyou template

This EyouCMS professional template is ideal for the website development and mini-program development industries. Its modern, tech-driven design is perfect for showcasing website creation projects, mini-program development services, technical support, and customer testimonials. It helps internet technology companies effectively present their brand online and attract potential customers. Template Overview | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for EyouCMS | EyouCMS...
👁 52
Responsive mobile game app download website template – 0569

Responsive mobile game app download website template – 0569 Practical Collection Yiyou template

An eYouCMS template designed for responsive mobile games, gaming platforms, and app download websites. Its dynamic, tech-driven design is ideal for showcasing game products, mobile apps, download services, and gaming guides. This template helps gaming platforms attract players online and increase download numbers. Template Display | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for eYouCMS | eYou...
👁 53
Mobile App Promotion Website Template 0570

Mobile App Promotion Website Template 0570 Practical Collection Yiyou template

This EyouCMS template is ideal for promoting mobile apps, featuring a modern, tech-driven design that showcases app functionalities, interface screenshots, download guidance, and user reviews. It helps app developers create high-conversion promotional pages online. Template Preview | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for EyouCMS | EyouCMS (E...
👁 65
Resource website typecho001 template

Resource website typecho001 template Program Notes Typecho

typecho001 template template please do not modify the folder name of this template. The folder name is: typecho001 1.4 Fix the js output problem on the article page 1.3 Fix the error prompt when the plug-in is not installed Optimize the list page code output 1.2 Fix the comment function and add a custom homepage title 1.1 Fix the comment reply asymmetry function Add a separate title setting function on the homepage Add the website favicon.ico icon Add one...
👁 198
Website Digital Marketing Design & Website Templates – 0571

Website Digital Marketing Design & Website Templates – 0571 Practical Collection Yiyou template

An EyouCMS template designed for the website development, digital marketing, and design industries. Its modern, tech-driven design style enables effective presentation of website creation cases, digital marketing strategies, design portfolios, and corporate strength – helping digital marketing agencies attract corporate clients online. Template Display | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for EyouCMS | EyouCMS (Ey...
👁 48
Modification of typecho paging style

Modification of typecho paging style Program Notes Typecho

Sir, times have changed! Typecho is currently the most perfect solution, because Baidu can only see the code of fixed thinking. The actual generated HTML code is breathtakingly clean and fully customized, including adding classes to the li element, adding classes to the a element, adding classes to the previous page and next page, and removing the li tags that come with typecho to express more. I can even add some text to the content inside...
👁 517