Expand my Community achievements bar.

SOLVED

Curl command to set date property value

Avatar

Level 4

Hi,

How can I set date as a property value on a node using CURL command?

Currently I am trying to execute below curl command but it is setting as String property.

curl -u "user:pwd" --data "displayDate=2016-10-19T09:16:43.215-04:00" http://localhost:4502/content/my-site/my-page/jcr:content

Thanks,

Radha Krishna N

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

Could you please try to add typeHint as well in your command e.g.

curl -u "user:pwd" --data "displayDate=2016-10-19T09:16:43.215-04:00" -F "displayDate@TypeHint=Date" http://localhost:4502/content/my-site/my-page/jcr:content 



Arun Patidar

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Hi,

Could you please try to add typeHint as well in your command e.g.

curl -u "user:pwd" --data "displayDate=2016-10-19T09:16:43.215-04:00" -F "displayDate@TypeHint=Date" http://localhost:4502/content/my-site/my-page/jcr:content 



Arun Patidar

Avatar

Level 4

Hi All,

After surfing over net for couple of hours, found the solution!!

We need to pass TypeHint as Date [1]

So the curl command will be

curl -u "user:pwd" --data "displayDate=2016-10-19T09:16:43.215-04:00" --data "displayDate@TypeHint=Date" http://localhost:4502/content/my-site/my-page/jcr:content

[1] Sling over HTTP | Jukka Zitting

Thanks,

Radha Krishna N