M
M
Maxim2015-10-16 10:35:19
symfony
Maxim, 2015-10-16 10:35:19

How to correctly specify the date / time in the POST parameter?

I'm trying to post data with curl like this:

curl.exe -X POST -d caption=test -d description=test -d start_plan="2015-10-16 10:22:45" -d owner=1 localhost:8000/api/test/

"start_plan" DATETIME
But symfony swears that this field cannot be null
Integrity constraint violation: 1048 Column 'start_plan' cannot be null

Maybe I'm setting the parameter wrong?
upd: You just need to look into the profiler
Message	                              Origin	                          Cause
This value is not valid.	start_plan	     Symfony\Component\Validator\ConstraintViolation
Object(Symfony\Component\Form\Form).children[start_plan] = 2015-10-16 10:22:45

this object also contains others (date, time)
[
  date => [
    year => , 
    month => , 
    day => 
  ], 
  time => [
    hour => , 
    minute => 
  ]
]

How to correctly specify this in the request?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2015-10-17
@maxpointn2point

The question is closed. And moved HERE

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question