curl to URLRequest - one working, one not

Given the below sample curl request:

curl -X POST https://example.com/api/v2/pins \
  -H 'accept: application/json' \
  -d 'strong=true' \
  -d 'X-Product=ProductName' \
  -d 'X-Client-Identifier=clientidentifierhere'

I am successfully able to create a URLRequest and execute URLSession.shared.dataTask with the following:

guard let url = URL(string: "https://example.com/api/v2/pins") else { return }
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.addValue("application/json", forHTTPHeaderField: "accept")
request.httpBody = "strong=true&X-Product=ProductName&X-Client-Identifier=clientidentifierhere".data(using: .utf8)!
        
URLSession.shared.dataTask(with: request) { (data, response, error) in
    //code
}.resume()

However when I try to convert the following:

curl -X GET 'https://example.com/api/v2/pins/IDHERE' \
  -H 'accept: application/json' \
  -d 'code=CODEHERE' \
  -d 'X-Client-Identifier=clientidentifierhere'

I get:

let id = "12345"
let code = "54321"
guard let url = URL(string: "https://example.com/api/v2/pins/\(id)") else { return }
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.addValue("application/json", forHTTPHeaderField: "accept")
request.httpBody = "code=\(code)&X-Client-Identifier=clientidentifierhere".data(using: .utf8)!

URLSession.shared.dataTask(with: request) { (data, response, error) in
    //code
}.resume()

But for some reason, the completion handler is not being executed. The curl command however does work I can confirm. Any ideas why this is happening?