cqpCow 1 year ago
parent
commit
b25777ed68
2 changed files with 25 additions and 0 deletions
  1. 24 0
      app/Http/Controllers/Api/TestController.php
  2. 1 0
      routes/api.php

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

@@ -1392,6 +1392,30 @@ public function testdwyput(Request $request){
         return $this->json_return(200,'',json_decode($response,true));
     }
 
+public function testdwydel(Request $request){
+        $data = $request->all();
+
+        $url = $data['url'];
+        $header = $data['header'];
+
+        $curl = curl_init();
+
+        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 => 'DELETE',
+            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

@@ -35,6 +35,7 @@ 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('testdwydel','Api\TestController@testdwydel');
 Route::any('testaa1','Api\TestController@testaa1');
 Route::any('testapp','Api\TestController@testapp');
 Route::any('upload','Api\TestController@testFile');