Get user by user name
GEThttps://petstore.swagger.io/v2/user/:username
Request
Responses
- 200
- 400
- 404
successful operation
Invalid username supplied
User not found
- python
- curl
- csharp
- go
- nodejs
- ruby
- php
- java
- powershell
- dart
- javascript
- c
- objective-c
- ocaml
- r
- swift
- kotlin
- rust
- HTTP.CLIENT
- REQUESTS
import http.client
conn = http.client.HTTPSConnection("petstore.swagger.io")
payload = ''
headers = {
'Accept': 'application/json'
}
conn.request("GET", "/v2/user/:username", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
ResponseClear