How to use the HTTP API to create an asset in an AEM instance. I am using the below code and getting a 500 Server error.
Solved! Go to Solution.
Views
Replies
Total Likes
There must be a log entry (most likely an exception) in the error.log, which gives more information about this statuscode 500. Can you share that exception?
(Very unlikely that the CSRF filter is causing this. Because a few user agents are explicitly listed, which are ignored by the filter.)
Please refer to the below community post. It could because of anonymous post request. Either remove post from sling referee filter or add csrf header..
Hi @debasis-swain ,
Have you met the prerequisite to use asset API?
Please follow the below step.
Below document details about asset API in detail. Also possible error scenarios
There must be a log entry (most likely an exception) in the error.log, which gives more information about this statuscode 500. Can you share that exception?
(Very unlikely that the CSRF filter is causing this. Because a few user agents are explicitly listed, which are ignored by the filter.)
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi, the problem seems to be:
Exception while processing request to /api/assets/target-assets/new/hiking_5.jpg (org.eclipse.jetty.http.BadMessageException: 501: Unsupported Content-Encoding) org.eclipse.jetty.http.BadMessageException: 501: Unsupported Content-Encoding at org.eclipse.jetty.server.Request.extractContentParameters(Request.java:460)
"Unsupported Content-Encoding" is definitely something caused by the request. The respective code is here: https://github.com/eclipse/jetty.project/blob/jetty-9.4.12.v20180830/jetty-server/src/main/java/org/...
Can you try to do the same with curl, just to find out what's the difference?
Views
Replies
Total Likes