Teapot or Zinc adding extra node to JSON POST

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Teapot or Zinc adding extra node to JSON POST

BrunoBB
Hi,

Using Teapot (which uses Zinc) i found something i do not know if it is a
standard or done on purpose or a bug.

A Teapot service (POST) accept a JSON entry. In the client the 'body' is set
with the JSON.

In the server the ZnRequest contents insert a JSON node 'body' to the
original JSON.

The original JSON POST is: {name: "John", age: 31, city: "New York"}

At server ZnRequest contents JSON is: {"body":{name: "John", age: 31, city:
"New York"}}

Is this done on purpose by Zinc ?

I try to find if it is a standard in JSON communications but with no luck
yet !
(these are first steps on JSON so maybe is a newbie question :)

regards,
bruno



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Reply | Threaded
Open this post in threaded view
|

Re: Teapot or Zinc adding extra node to JSON POST

Esteban A. Maringolo
I can't speak for Teapot, but I can tell you that the extra "body"
container object is not standard for JSON/REST API's.

Are you certain that it isn't the client who's adding such container
to the request?

Regards,


Esteban A. Maringolo

El mié., 27 feb. 2019 a las 18:56, BrunoBB (<[hidden email]>) escribió:

>
> Hi,
>
> Using Teapot (which uses Zinc) i found something i do not know if it is a
> standard or done on purpose or a bug.
>
> A Teapot service (POST) accept a JSON entry. In the client the 'body' is set
> with the JSON.
>
> In the server the ZnRequest contents insert a JSON node 'body' to the
> original JSON.
>
> The original JSON POST is: {name: "John", age: 31, city: "New York"}
>
> At server ZnRequest contents JSON is: {"body":{name: "John", age: 31, city:
> "New York"}}
>
> Is this done on purpose by Zinc ?
>
> I try to find if it is a standard in JSON communications but with no luck
> yet !
> (these are first steps on JSON so maybe is a newbie question :)
>
> regards,
> bruno
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>

Reply | Threaded
Open this post in threaded view
|

Re: Teapot or Zinc adding extra node to JSON POST

BrunoBB
Esteban,

You are right !, the client is the culprint :)

Regards,
bruno



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html