Update user resource.
PUT
/user/{username}
curl -X PUT 'https://petstore3.swagger.io/api/v3/user/string' \ -H 'Content-Type: application/json' \ -d '{"email":"john@email.com","firstName":"John","id":10,"lastName":"James","password":"12345","phone":"12345","userStatus":1,"username":"theUser"}'package main
import ( "context" "net/http" "strings")
func main() { ctx := context.Background() body := strings.NewReader(`{"email":"john@email.com","firstName":"John","id":10,"lastName":"James","password":"12345","phone":"12345","userStatus":1,"username":"theUser"}`) req, err := http.NewRequestWithContext(ctx, "PUT", "https://petstore3.swagger.io/api/v3/user/string", body) if err != nil { panic(err) } req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close()}import requests
response = requests.request( "PUT", "https://petstore3.swagger.io/api/v3/user/string", headers={"Content-Type": "application/json"}, data='{"email":"john@email.com","firstName":"John","id":10,"lastName":"James","password":"12345","phone":"12345","userStatus":1,"username":"theUser"}',)print(response.json())const response = await fetch('https://petstore3.swagger.io/api/v3/user/string', { method: 'PUT', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({"email":"john@email.com","firstName":"John","id":10,"lastName":"James","password":"12345","phone":"12345","userStatus":1,"username":"theUser"}),});const data = await response.json();This can only be done by the logged in user.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” username
required
string
Name that need to be deleted
Request Body
Section titled “Request Body ”Update an existent user in the store
object
email
string
Example
john@email.com firstName
string
Example
John id
integer format: int64
Example
10 lastName
string
Example
James password
string
Example
12345 phone
string
Example
12345 userStatus
User Status
integer format: int32
Example
1 username
string
Example
theUserobject
email
string
Example
john@email.com firstName
string
Example
John id
integer format: int64
Example
10 lastName
string
Example
James password
string
Example
12345 phone
string
Example
12345 userStatus
User Status
integer format: int32
Example
1 username
string
Example
theUserobject
email
string
Example
john@email.com firstName
string
Example
John id
integer format: int64
Example
10 lastName
string
Example
James password
string
Example
12345 phone
string
Example
12345 userStatus
User Status
integer format: int32
Example
1 username
string
Example
theUserResponses
Section titled “ Responses ”Successful operation
Bad request
User not found
default
Section titled “default ”Unexpected error