-
Notifications
You must be signed in to change notification settings - Fork 529
Closed
Description
Hi,
I'm testing DocumentConversion API and I get the following exception:
nov 18, 2015 11:05:26 AM com.ibm.watson.developer_cloud.service.WatsonService execute
SEVERE: https://gateway.watsonplatform.net/document-conversion-experimental/api/v1/convert_document, status: 415, error: The media type is not supported
Exception in thread "main" com.ibm.watson.developer_cloud.service.UnsupportedException: The media type is not supported
Document is in Word format, it contains text, not images.
The java test code is the following:
service = new DocumentConversion();
service.setUsernameAndPassword(credentials.getUser(), credentials.getPassword());
File docfile = new File("/watson/input_docs/test/test2.doc");
String content = service.convertDocumentToHTML(docfile , "application/msword");
When I try same document using curl, it WORKS FINE (I have masked user/password):
curl -u "{user}":"{pasword}" -o "/cygdrive/c/watson/input_docs/test/test2.html" \
-F 'config={"conversion_target":"NORMALIZED_HTML"};type=application/json' \
-F file="@/cygdrive/c/watson/input_docs/test/test2.doc;type=application/msword" \
"https://gateway.watsonplatform.net/document-conversion-experimental/api/v1/convert_document"
Could you give me any advice on this?
Metadata
Metadata
Assignees
Labels
No labels