Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const makePutRequest = () => {
// The id being created here should be unique, otherwise an update will actually happen
const id = `${Date.now() + Math.random()}`
patient.id = id
const response = http.put(`${BASE_URL}${RESOURCE_PATH}/${id}`,
JSON.stringify(patient),
{
headers: {
'Content-Type': 'application/json'
},
tags: {
name: `Patient Update-Create Stress Test`
}
})
check(response, {
'status code is 201': r => r.status === 201
})
}