zoukankan      html  css  js  c++  java
  • 简单php post请求

            for ($i = 1000; $i < 11000; $i++) {
                $url = '***********';
                $client = new GuzzleHttpClient();
                $response = $client->request(
                    'POST',
                    $url,
                    [
                        'headers' => ['Content-Type' => 'application/x-www-form-urlencoded'],
                        'form_params' => [
                            'appid' => 'qdcacxpfuvdxsxpuaeuvqadwffrauqww',
                            'v' => '1.0.0.0',
                            'os' => 'android',
                            'terminal' => '2',
                            'channel' => '',
                            'udid' => '10X40VI9PlVlUDTBftGbd9oRF3lIDe7lf'.$i,
                            'timestamp' => '20161230161048',
                            'token' => '',
                            'sign' => '109d3ce559c86e6869fc097b81bd90b3',
                            'page' => '1',
                            'step' => '10',
                            'programType' => 'news',
                            'programId' => 'c6293dbb56fd4223838a3edd0a8815d8'
                        ]
                    ]
                );
    
    
                $a = $response;
            }
    

      

       public function indexAction()
        {
            $url = '*****';
            $client = new GuzzleHttpClient();
    
            $jar = new GuzzleHttpCookieCookieJar();
            $jar->clear();
            foreach ($_COOKIE as $key => $value) {
                $newCookie = GuzzleHttpCookieSetCookie::fromString() ;  //::fromString($key'Name=' . $key . ';' . 'Value=' . $value . ';' . 'Domain=qa-api.dowedo.com.cn');
                $newCookie->setName($key);
                $newCookie->setValue($value);
                $newCookie->setDomain('qa-api.dowedo.com.cn');
                $jar->setCookie($newCookie);
            }
    
            $defaultOptions = ['cookies' => $jar];
            /**
             * Now loop through the cookies adding them to the jar
             */
    
    
            $response = $client->request(
                'GET',
                $url, $defaultOptions
            );
    
            $a = (string)$response->getBody();
            return $response;
        }
    

      

  • 相关阅读:
    导出表结构
    smarty cache
    浏览器插件
    互联网技术网站介绍
    目录拷贝
    sphinx搜索不到
    powerdesigner 导出数据库表结构
    PowerDesigner 连接 mysql
    update join
    ClipboardJS的坑,
  • 原文地址:https://www.cnblogs.com/psy-sdudio/p/8268260.html
Copyright © 2011-2022 走看看