500 error when trying to create a contact

Here’s the response I received. Would appreciate your help

{“status”:“error”,“message”:“internal error”,“correlationId”:“8a69d9e2-de63-4b5e-bc16-94eb9d933c4b”}

I tried these two endpoints and received the same error:

From https://developers.hubspot.com/docs/methods/contacts/create_contact

https://api.hubapi.com/contacts/v1/contact?hapikey=

From https://developers.hubspot.com/docs/methods/contacts/create_or_update

https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/{email address}/?hapikey=’

I was able to fix this issue by passing in the Content-Type string in the headers array in this way:

$res = $client->request(‘POST’, $endpoint, [

‘body’ => $post_json,

‘headers’ => [

‘Content-Type’ => ‘application/json’

]

]);