cqpCow 1 年之前
父节点
当前提交
a400dda204
共有 2 个文件被更改,包括 29 次插入0 次删除
  1. 28 0
      app/Http/Controllers/Api/TestController.php
  2. 1 0
      routes/api.php

+ 28 - 0
app/Http/Controllers/Api/TestController.php

@@ -1364,6 +1364,34 @@ public function testa(Request $request){
         return $this->json_return(200,'',json_decode($response,true));
     }
 
+public function testdwyput(Request $request){
+        $data = $request->all();
+
+        $url = $data['url'];
+        $post = $data['post'];
+        $header = $data['header'];
+
+        $curl = curl_init();
+        $json = str_replace('"workflowSearchBean":{}','"workflowSearchBean":[]',json_encode($post));
+        $json = str_replace('"workflowSearchBean":[]','"workflowSearchBean":{}',json_encode($post));
+        file_put_contents('1.txt',$json);
+        curl_setopt_array($curl, array(
+            CURLOPT_URL => $url,
+            CURLOPT_RETURNTRANSFER => true,
+            CURLOPT_ENCODING => '',
+            CURLOPT_MAXREDIRS => 10,
+            CURLOPT_TIMEOUT => 0,
+            CURLOPT_FOLLOWLOCATION => true,
+            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
+            CURLOPT_CUSTOMREQUEST => 'PUT',
+            CURLOPT_POSTFIELDS => $json,
+            CURLOPT_HTTPHEADER => $header,
+        ));
+        $response = curl_exec($curl);
+        curl_close($curl);
+        return $this->json_return(200,'',json_decode($response,true));
+    }
+
 public function testaa1(Request $request){
         $curl = curl_init();
 

+ 1 - 0
routes/api.php

@@ -34,6 +34,7 @@ Route::any('test', 'Api\TestController@aa');
 Route::any('testData','Api\TestController@testData');
 Route::any('testdwy','Api\TestController@testaa');
 Route::any('testdwyget','Api\TestController@testa');
+Route::any('testdwyput','Api\TestController@testdwyput');
 Route::any('testaa1','Api\TestController@testaa1');
 Route::any('testapp','Api\TestController@testapp');
 Route::any('upload','Api\TestController@testFile');