Should work fine. The message suggests the request is wrong, which may mean just about anything. Do GET requests work? If so, there is nothing wrong with the TLS setup and the problem is probably with the data format
Thanks for the quick reply. I’m making the same request successfully using the macOS Rested application, which allows the same parameterization of the POST request:
header('Content-Type','application/x-www-form-urlencoded') is most likely wrong. This will only succeed if the server responds with this header. You can use request_header (check), or better use form(Attributes) instead of atom(Body).
Made progress. I now receive the expected answer from the web service but with a warning:
Warning: Domain error: 'set_cookie' expected, found ''...''. (an atom)
This happens with library(http/http_cookie) loaded (not sure is required as I’m only using the HTTP client libraries). It sounds like the cookie provided by the web service is not being correctly handled by the code expected to save it?
Using library(http/http_cookie) is mostly intended for clients AFAIK. It scans replies for cookies and maintains a database thereof, applying the proper cookie to the next request. It is typically needed if some form of cookie based login is used by the site. There are also sites that redirect to themselves with a cookie on the first interaction and even get into a loop if you do not pass this cookie in the next request.
The warning simply suggests that the cookie doesn’t parse according to the HTTP cookie syntax. That may of course be an error in the library, but sites sending illegal cookies are not uncommon