ibm-watsondocument-conversion

Document Conversion Code 400


When I do this command:

C:\curl -X POST -u "User":"Pass" -F config="{\"conversion_target\":\"answer_units\"}" -F file="D:\PATH\QeA.pdf;type=application/pdf" "https://gateway.watsonplatform.net/document-conversion/api/v1/convert_document?version=2015-12-15"

I get this message:

{
  "code" : 400,
  "error" : "Error: End-of-File, expected line"
}

And I've used this command but now I get this error message.


Solution

  • I believe it's a slight syntax error in your curl command - instead of

    -F file="D:\PATH\QeA.pdf;type=application/pdf"
    

    try:

    -F file="@D:\PATH\QeA.pdf;type=application/pdf"