---
title: Updates a pet in the store with form data
slug: mihai-tests/yfQf-updates-a-pet-in-the-store-with-form-data
createdAt: 2023-11-09T13:52:55.274Z
---

{
  "id": "_CN5NcieOE4xTnjRyUnwY",
  "type": "api-oas-v2",
  "data": {
    "request": {
      "oAuthParameters": [],
      "pathParameters": [
        {
          "kind": "required",
          "name": "petId",
          "type": "integer",
          "description": "ID of pet that needs to be updated",
          "value": "1234"
        }
      ],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [
        {
          "name": "name",
          "kind": "optional",
          "type": "string",
          "description": "Updated name of the pet",
          "example": "",
          "value": "bb"
        },
        {
          "name": "status",
          "kind": "optional",
          "type": "string",
          "description": "Updated status of the pet",
          "example": "",
          "value": "bbb"
        }
      ]
    },
    "method": "POST",
    "url": "//petstore.swagger.io/sandbox/pet/1234",
    "servers": [
      {
        "url": "//petstore.swagger.io/v2/pet/{petId}",
        "description": "Default server"
      },
      {
        "url": "//petstore.swagger.io/sandbox/pet/{petId}",
        "description": "Sandbox server"
      }
    ],
    "examples": {
      "selectedLanguageId": "RZa1on-ez4NeFMpTcb60j",
      "languages": [
        {
          "id": "RZa1on-ez4NeFMpTcb60j",
          "language": "curl",
          "code": "curl --location '//petstore.swagger.io/sandbox/pet/1234' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--form 'name=\"bb\"' \\\n--form 'status=\"bbb\"'"
        },
        {
          "id": "_3rK9KB_QErMIINgVgIg9",
          "language": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"Accept\", \"application/json\");\nmyHeaders.append(\"Content-Type\", \"application/json\");\n\nvar formdata = new FormData();\nformdata.append(\"name\", \"bb\");\nformdata.append(\"status\", \"bbb\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: formdata,\n   redirect: 'follow'\n};\n\nfetch(\"//petstore.swagger.io/sandbox/pet/1234\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "xKS1U_N5k00irSxtuIKjs",
          "language": "ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"//petstore.swagger.io/sandbox/pet/1234\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Content-Type\"] = \"application/json\"\nform_data = [['name', File.open('undefined')],['status', File.open('undefined')]]\nrequest.set_form form_data, 'multipart/form-data'\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "Q_BSIR2gXPESzcTlj-iho",
          "language": "python",
          "code": "import requests\nimport json\n\nurl = \"//petstore.swagger.io/sandbox/pet/1234\"\n\npayload = {}\nfiles=[\n\n]\nheaders = {\n   'Accept': 'application/json',\n   'Content-Type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload, files=files)\n\nprint(response.text)\n"
        }
      ]
    },
    "results": {
      "languages": [
        {
          "id": "response-0-405",
          "language": "405",
          "code": "// Invalid input\n"
        }
      ],
      "selectedLanguageId": "response-0-405"
    },
    "responses": [
      {
        "statusCode": "405",
        "description": "Invalid input",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "description": ""
  },
  "children": [
    {
      "text": ""
    }
  ]
}