uploads an image
POSThttps://petstore3.swagger.io/api/v3/pet/:petId/uploadImage
Request
Path Parameters
petId int64required
ID of pet to update
Query Parameters
additionalMetadata string
Additional Metadata
- application/octet-stream
Body
stringbinary
Responses
- 200
successful operation
- application/json
- Schema
- Example (auto)
Schema
codeint32
typestring
messagestring
{
"code": 0,
"type": "string",
"message": "string"
}
Authorization: oauth2
name: petstore_authtype: oauth2scopes:write:pets,read:pets
flows: { "implicit": { "authorizationUrl": "https://petstore3.swagger.io/oauth/authorize", "scopes": { "write:pets": "modify pets in your account", "read:pets": "read your pets" } } }
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://petstore3.swagger.io/api/v3/pet/:petId/uploadImage");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent(string.Empty);
content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear