I'm trying to communicate with an SMTP API from my IOS application. The API uses HTTPS requests, however, I'm unsure how to make one within Swift. The application exemplifies the following cURL request as a way of communicating with the API:
curl --request POST \
--url https://api.sendinblue.com/v3/smtp/email \
--header 'accept: application/json' \
--header 'api-key:YOUR_API_KEY' \
--header 'content-type: application/json' \
--data '{
"sender":{
"name":"Sender Alex",
"email":"senderalex@example.com"
},
"to":[
{
"email":"testmail@example.com",
"name":"John Doe"
}
],
"subject":"Hello world",
"htmlContent":"<html><head></head><body><p>Hello,</p>This is my first transactional email sent from Sendinblue.</p></body></html>"
}'
How can I make this request from my code project?
Any help would be greatly appreciated!