Curl command to set date property value | Community
Skip to main content
Radha_Krishna_N
June 14, 2018
Solved

Curl command to set date property value

  • June 14, 2018
  • 3 replies
  • 3498 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

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 

3 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
June 14, 2018

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
Radha_Krishna_N
June 14, 2018

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

Radha_Krishna_N
June 14, 2018

arunp99088702​ Thanks