"status":415,"code":"E_UNSUPPORTED_MEDIA_TYPE","message":"The specified media type application/octet
Hi,
I am trying to create a content using Angular 6 but unable to do so. I am using the below URL.
http://localhost:8080/dctm-rest/repositories/demo/folders/0b01e24080008993/documents
I am able to do in RestClient using Java but not in Angular 6 and receiving the below error.
Attached is the image of the request and response and the error message.
If you have any code related to upload in Angular 2.x or Angular 5/6 please let me know how to upload
Thanks
vinod.
Vinod Krishna
Architect, Consulting Services
OpenText
Comments
-
What's your payload and what's the content type? As explained in the error message, it must be application/vnd.emc.documentum+json.
0 -
content type should be Multiform/data and there is some issue in mentioning content-type = 'multipform/data' so we are mentioning it as undefined.
payload I am setting metadata and content in FormData.Vinod Krishna
Architect, Consulting Services
OpenText0 -
As explained in the Documentum REST Reference Guide (page 297 and following - "Import SysObject Metadata and Contents"), the payload must be multipart/form-data or multipart/mixed. Metadata part must be
Content-Disposition: form-data; name=metadata
Content-Type: application/vnd.emc.documentum+xmland content part must be
Content-Disposition: form-data; name=binary
Content-Type: <actual content type, e.g application/pdf)0 -
In Angular JS, Below configurations will create a mulitpart form.
const httpOptions = {
headers: new HttpHeaders({
'Accept': 'application/vnd.emc.documentum+json',
'Authorization': 'Basic ' + authToken,}) };
var fd = new FormData();
fd.append('data', JSON.stringify(docObj));
fd.append('content', body)
return this.http.post("http://localhost:8080/dctm-rest/repositories/demo/folders/0b01e24080008993/objects?format=pdf", fd, httpOptions); //workingVinod Krishna
Architect, Consulting Services
OpenText0
Categories
- All Categories
- 107 Developer Announcements
- 53 Articles
- 105 General Questions
- 141 IM Services
- 43 OpenText Hackathon
- 32 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 898 Cloud Fax and Notifications
- 76 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 118 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management