Hi, Shiv:

PATCH is changes nodes within an existing tree structure.  As such, it only 
makes sense for JSON or XML documents, which have tree structure.

For binary documents, just write the replacement document.  The request looks 
like it's sending the entire document, so PUT is the right method.


Hoping that clarifies,


Erik Hennum


________________________________
From: [email protected] 
[[email protected]] on behalf of Shiv Shankar 
[[email protected]]
Sent: Friday, August 19, 2016 1:14 PM
To: [email protected]
Subject: [MarkLogic Dev General] Patch update PDF/binary data

Hi,
I am getting when I do patch update of binary data to an existing json object.

url -v -X POST   --basic --user  user:pwd
 --data-binary '@mydoc.pdf'   -i -H "Content-type: application/binary"
   -H "X-HTTP-Method-Override: PATCH"   
'http://localhost:8004/LATEST/documents?uri=/test/899'

Error below:::

{"errorResponse":{"statusCode":400, "status":"Bad Request", 
"messageCode":"RESTAPI-INVALIDREQ", "message":"RESTAPI-INVALIDREQ: 
(err:FOER0000) Invalid request:  reason: patch is not <rapi:patch> or JSON 
patch object for uri: /test/899"}}


Any advice or is there any other way like apart from insert binary and put that 
uri as patch to existing document?
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to