4
I’m using Angular to register in the database, I take the data of my inputs put into an object and turn into a JSON and send by post, but it turns out that my JSON is cut and I don’t have a clue why.
var meuJson = angular.toJson(meuObjeto);
$http({
method: 'POST',
url: 'http://url/arquivo.php',
data: {
'data': meuJson
}
})
.success(function (data){
console.log(data);
})
My JSON is popping up like this.
[
{
"uuid":"56456456456456456456465456"
},
{
"store_name":"",
"store_email":"",
"store_facebook":"",
"contact_name":"Juca",
"contact_email":"[email protected]",
"contact_facebook":"http://localho
I gave a console.log()
with Json when I pick him up and show him, then I show the answer, see the image that gets better to understand:
He’s cutting before uploading or in the.php file?
– Alessandro Gomes
Do you store JSON in the database and retrieve it? Or do you convert a query in the database into a JSON?
– Diego Lopes Lima
@Alessandrogomes when I give the console.log on my machine before sending it is correct. So on
arquivo.php
i give avar_dump($_POST)
and appears already cut.– bemontibeller
@Diegolopeslima I saved it on site Recovery and shipping Storage.
– bemontibeller
Can I try to give more details please?
– Diego Lopes Lima
@Diegolopeslima, a json is sent via POST, to a.php file, this php file does nothing but give a
var_dump($_POST)
(we are debugging), appears the string that is being sent, only cut, as described in the question.– bemontibeller
Are you using any CMS, framework or template engine? (Wordpress for example)
– Diego Lopes Lima
@Diegolopeslima, no, pure php.
– bemontibeller
Have you tried with jQuery?
– GarouDan
You can post the respective PHP snippet you receive?
– Bacco
@Khronna, you can put the whole JSON, or at least the line following the part where it is cut? I have a suspicion.
– Sergio
@Sergio I’m participating in this project too, so I put an image of the console with the entire array and then how it comes back.
– filipelinhares
Follow in Fiddler2 and see how the request and response are behaving
– Roger Barretto