Use 50% Discount for all private proxies!
Unlimited possibilities with ExtraProxies

Magento 2.4.6. Unable to output data to json

I have a problem with the json output when sending a request to the API.

I receive data in this format:

"{\n    \"name\": \"John\",\n    \"age\": 30,\n    \"car\": null,\n   \"address\": {\n        \"street\": \"123 Main St\",\n        \"city\": \"Anytown\",\n        \"zip\": \"12345\"\n    }\n}" 

I need the data in this format:

{     "name": "John",     "age": 30,     "car": null,     "address": {         { "street": "123 Main St",         "city": "Anytown",         "zip": "12345"     } } 

Am I correct in understanding that this is because I am using such an interface on my side?

namespace Dev\RestApi\Api;  interface TestInterface {     /**     *     * @return string     */     public function testMethod(); } 

My Model:

namespace Dev\RestApi\Model;  use Dev\RestApi\Api\TestInterface;  class TestModel implements TestInterface {     public function testMethod()     {          $  data = [             'name' => 'John',             'age' => 30,             'car' => null,             'some' => null,             'address' => [                 'street' => '123 Main St',                 'city' => 'Anytown',                 'zip' => '12345'             ]         ];          $  jsonResponse = json_encode($  data, JSON_PRETTY_PRINT);          return $  jsonResponse;     } } 
Related Posts
DreamProxies 100 Proxies 200 Proxies 400 Proxies 1000 Proxies 2000 Proxies 5000 Proxies 10000 Proxies

Garuda138 Ajaib88 Asia77

Ganas69 Uber77 Gacor77