I have a script which uses a variable which contains a value in the form of '11/12/2014 07:58:08.157'. The script contains a curl
command with this variable forming part of the http body (JSON request). The issue is the server is throwing a JSON parser error when this value is passed in the body. Replacing this value with '11/12/2014' seems to work fine, so it seems the time part of this string is causing issues. Using an echo
command I have seen the curl
command have this value enclosed in double quotes. (I have even tried single quotes.) Either way, I am still getting a JSON parser error. Removing the time component leads to another functional error, so I am hard pressed to pass both the date and time value to the server in the JSON body.
Asked
Active
Viewed 144 times
0
-
1Please include the full value of the variable and an example of the command you are calling with `curl`. – b4hand Dec 12 '14 at 07:03
-
& What is the expected (escaped) value of that variable? – anishsane Dec 12 '14 at 07:06
-
http://stackoverflow.com/questions/10286204/the-right-json-date-format – martin clayton Dec 12 '14 at 07:51