The following code snippets are examples of calling the Rebuild API using NodeJS. The request library is used to execute calls to the API.
In this example files are loaded from the OS and a request with the content type of 'application/json' is formed. The request is then sent to the API using the POST method. The JSON body also contains the content management flags.
The rebuilt file is returned as Base64, decoded by the client and written to disk.
In this example a file is downloaded from an input URL with a GET operation and its contents are rebuilt. The rebuilt file is then uploaded to the specified output URL using a PUT operation.
In this example the contents of the raw file are uploaded in a body with a content type of 'multipart/form-data'. The content management flags are serialised and sent as part of the form.
The rebuilt file contents are returned to the client and written to disk.