]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - support/doc/api/openapi.yaml
Merge branch 'develop' into 'develop'
[github/Chocobozzz/PeerTube.git] / support / doc / api / openapi.yaml
index 4607bacfb686566a8447fa5d44653f8d2ba2c54d..032d798fc42cea6288147183b18adeac356e7368 100644 (file)
@@ -1,7 +1,7 @@
 openapi: 3.0.0
 info:
   title: PeerTube
-  version: 1.4.1
+  version: 2.0.0
   contact:
     name: PeerTube Community
     url: 'https://joinpeertube.org'
@@ -160,35 +160,25 @@ paths:
             http -b GET https://peertube2.cpy.re/api/v1/accounts/{name}/videos
         - lang: Ruby
           source: |
-            require 'uri'
             require 'net/http'
+            require 'json'
 
-            url = URI("https://peertube2.cpy.re/api/v1/accounts/{name}/videos")
+            uri = URI.parse("https://peertube2.cpy.re/api/v1/accounts/{name}/videos")
 
-            http = Net::HTTP.new(url.host, url.port)
+            http = Net::HTTP.new(uri.host, uri.port)
             http.use_ssl = true
-            http.verify_mode = OpenSSL::SSL::VERIFY_NONE
 
-            request = Net::HTTP::Post.new(url)
-            request["content-type"] = 'application/json'
-            response = http.request(request)
-            puts response.read_body
+            response = http.get(uri.request_uri)
+
+            puts JSON.parse(response.read_body)
         - lang: Python
           source: |
-            import http.client
-
-            conn = http.client.HTTPSConnection("https://peertube2.cpy.re/api/v1")
-
-            headers = {
-              'content-type': "application/json"
-            }
-
-            conn.request("POST", "/accounts/{name}/videos", None, headers)
+            import requests
 
-            res = conn.getresponse()
-            data = res.read()
+            r = requests.get("https://peertube2.cpy.re/api/v1//accounts/{name}/videos")
+            json = r.json()
 
-            print(data.decode("utf-8"))
+            print(json)
   /accounts:
     get:
       tags: