0

I searched and found this related post, and use it as the basis for this question

Simple C example of doing an HTTP POST and consuming the response

Jerry's code works perfectly, but I have an unusual issue. I have Cloudflare implemented on the destination server, which means that the destination cannot be addressed by IP, it has to be directed to the fully qualified domain URL. I proved this by using the code, but got a return message from Cloudflare informing me that the IP could not be used.

My question is, will C support POST to a URL, or does it have to be to an IP address? If if will accept the domain, what can I do to alter that code ?

Community
  • 1
  • 1
Richbm
  • 1

1 Answers1

0

I think http POST should be working fine with URL. You can either use domain name or direct ip. both should work.

In your code, try to edit the variable 'host'.

Jiechao Li
  • 356
  • 3
  • 7
  • 17
  • Hi, That was the approach I tried initially, but the code converts the value of the host variable to an IP. – Richbm Mar 18 '15 at 12:11