1

I am trying to PUT a PHP array as a json. This is what I have done:

$data = array('Customer Name' => 'White Carousel', 'Delivery Address'=>'2 Example Dr', 'Contact Phone Number'=>'555555555');
$json_data = json_encode($data);

When I try to PUT this, I am getting a 400 error.

Why is this?

I know what an Error 400 is, but I dont understand why it is coming here. What is wrong with my syntax?

Matt
  • 85
  • 7
  • straight duplicate of **[this question](http://stackoverflow.com/questions/19671317/400-bad-request-http-error-code-meaning)** ... although typically you would POST to a server providing some kind of RESTful API. – YvesLeBorg Jul 05 '16 at 21:26
  • What do you mean when I try to `PUT` this? – Dharam Jul 05 '16 at 21:32
  • In the documentation of the API I'm communicating, it says that to update a record, I need to use a `PUT` request – Matt Jul 05 '16 at 21:33
  • When I say I am trying to `put` this json, I mean that I am trying to update a record on the API with this code. – Matt Jul 05 '16 at 21:34

0 Answers0