You don't need to create a custom request using cURL to make this request, a regular HTTP POST will suffice. Another part of the problem is that you are also setting the POSTFIELDS
and custom request to the same thing which was the HTTP request you constructed so the entire request consists largely of two duplicate strings.
Try this code and study it to understand how it works: