When creating content, you have a slightly different URI to other API requests. The URI is /entity/{type}, so, to create a new node, you would make a POST request to /entity/node. When sending a POST request, you provide the type of data provided using the Content-Type header. So, to create a new node using HAL JSON, there would be a Content-Type: application/hal+json header in your request. To test this using cURL you would make the following request:
curl --include --request POST --user myusername:mypassword --header 'Content-type: application/hal+json' http://localhost/entity/node?_format=hal_json --data-binary '{"_links":{"type":{"href":"http://localhost:8080/rest/type/node/article"}},"title":[{"value":"Example node title"}],"type":[{"target_id":"article"}]}'
When you send the request using HAL JSON you need to provide the type of the new entity using _links. This is provided in the form of a URL which needs to match the hostname and protocol of the web server itself. For example, if you are running Varnish or some other reverse proxy on port 80 and the web server on port 8080, the link to the entity type and bundle needs to be on port 8080 as well. If the request is successful, you will receive a 201 Created response that contains a Location header, which contains the URL to the new node. In Drupal 8.1.0 or higher the response will be a 200 OK response with the serialized version of the entity, the same as you would receive if you made a GET request.