Stefan Reeder
04/12/2024, 2:15 AMheaders: { 'X-HTTP-Method-Override': 'PATCH'}
but it is not recognised in the other system.battk
04/12/2024, 2:36 AMStefan Reeder
04/12/2024, 2:37 AMbattk
04/12/2024, 3:02 AMbattk
04/12/2024, 3:02 AMAnthony OConnor
04/12/2024, 3:15 AMAnthony OConnor
04/12/2024, 3:20 AM3rd party server object exists as
{
id: 1001,
name: 'abc',
foo: 1,
bar: 17
}
if you were to do a PATCH
{
id: 1001,
name 'def'
}
the object would update to
{
id: 1001,
name 'def',
foo: 1,
bar: 17
}
if you wanted that same result with PUT you'd have to send
{
id: 1001,
name: 'def',
foo: 1,
bar: 17
}
that is to say you have to include all the data elements even those ones you're not updating because otherwise those elements get wiped out completely.
so if you PUT
{
id: 1001,
name 'def'
}
then that's exactly what the obj would be when you're done
it would have a foo or bar value at all
battk
04/12/2024, 3:21 AMbattk
04/12/2024, 3:21 AMAnthony OConnor
04/12/2024, 3:23 AMbattk
04/12/2024, 3:25 AMAnthony OConnor
04/12/2024, 3:26 AMAnthony Nooren
04/12/2024, 7:37 PMStefan Reeder
04/13/2024, 12:49 AMAnthony Nooren
04/13/2024, 1:59 AMStefan Reeder
04/13/2024, 1:25 PMAnthony Nooren
04/13/2024, 1:39 PMStefan Reeder
04/15/2024, 6:37 AMNElliott
04/15/2024, 9:46 AMStefan Reeder
04/16/2024, 7:57 AM