Monday, April 3, 2017

Why API returns all property values as string in my json

On my previous server which was hosted on godaddy my API return the string just fine while moving to digitalocean my Api is not behaving the same when it comes returning json.

In Godaddy I was using php version PHP 5.5.38 while in digitalocean I am using PHP 5.5.9-1.

This is a json response from Godaddy:

{id: 248, user_id: 519, total_score: 29, team_id: 35, gender: "m"}

This is from digitalocean:

{id: "248", user_id: "519", total_score: "29", team_id: "35", gender: "m"}

The second response from digitalocean is making me problem on my client-side apps, so I would appreciate if anyone knows what is the issue in here?

I am using same version of Laravel 5.0 on both hosts.



via Samuel

Advertisement