# Authenticating with the credentials "administrator" and password "5ecr3t" on a localhost instance running on port 8080
curl --user administrator:5ecr3t -H "Content-Type: application/xml" -X POST http://localhost:8080/midpoint/ws/rest/resources -d @pathToMidpointGit\samples\rest\opendj-resource-sync.xml -v
Example of creating an midPoint object either representing some identity data in the form of a new User type object or the creation of a new midPoint resource object.
For the purpose of the sample we are using the CURL tool as it is a well maintained, well tested, and it’s widely accessible.
The body of the request will contain data from an external configuration file, the data will be inserted into the request via native Curl commands.
If you are using file as a source for the data in the REST call with curl, please, don’t forget to use '@' before the path to your file.
Sometimes the newlines are not correctly handled during the transfer.
(See MID-5229.) If that occurs, please use
Show data source example for *"Create a new Resource object in MidPoint"