Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #25799 > unrolled thread

POSTed json

Started byAndrew Poulos <ap_prog@hotmail.com>
First post2014-09-02 14:34 +1000
Last post2014-09-02 09:28 +0000
Articles 3 — 2 participants

Back to article view | Back to comp.lang.javascript


Contents

  POSTed json Andrew Poulos <ap_prog@hotmail.com> - 2014-09-02 14:34 +1000
    Re: POSTed json Andrew Poulos <ap_prog@hotmail.com> - 2014-09-02 15:39 +1000
    Re: POSTed json Denis McMahon <denismfmcmahon@gmail.com> - 2014-09-02 09:28 +0000

#25799 — POSTed json

FromAndrew Poulos <ap_prog@hotmail.com>
Date2014-09-02 14:34 +1000
SubjectPOSTed json
Message-ID<4PKdnZynDLJY1JjJnZ2dnUVZ_q6dnZ2d@westnet.com.au>
I'm currently looking into an elearning "standard" called Tin Can (TC). 
TC sends "statements" (json) to the learning record store (LRS). I can 
follow everything that the sample I downloaded is doing except for one bit.

When the sample gets to an test and the user clicks the Submit button a 
statement for each question is POSTed to the LRS within an array. So if 
there are 10 questions you get a 11 element array where each element is 
json and one element is json describing the test.

The developer tools in Chrome shows the request payload correctly ie 
statements for all questions are as expected.

I'm confused. Is a stringified array of objects valid for json:
[
  {blah},
  {blah},
  {blah},
  {blah},
  {blah},
  {blah},
  {blah},
  {blah},
  {blah}
]

Andrew Poulos

[toc] | [next] | [standalone]


#25800

FromAndrew Poulos <ap_prog@hotmail.com>
Date2014-09-02 15:39 +1000
Message-ID<1sidnfgVFrJOxZjJnZ2dnUVZ_tKdnZ2d@westnet.com.au>
In reply to#25799
On 2/09/2014 2:34 PM, Andrew Poulos wrote:
> I'm currently looking into an elearning "standard" called Tin Can (TC).
> TC sends "statements" (json) to the learning record store (LRS). I can
> follow everything that the sample I downloaded is doing except for one bit.
>
> When the sample gets to an test and the user clicks the Submit button a
> statement for each question is POSTed to the LRS within an array. So if
> there are 10 questions you get a 11 element array where each element is
> json and one element is json describing the test.
>
> The developer tools in Chrome shows the request payload correctly ie
> statements for all questions are as expected.
>
> I'm confused. Is a stringified array of objects valid for json:
> [
>   {blah},
>   {blah},
>   {blah},
>   {blah},
>   {blah},
>   {blah},
>   {blah},
>   {blah},
>   {blah}
> ]

Sorry, Google provided the answer - its valid though a top-level object 
is preferred for security reasons.

Andrew Poulos

[toc] | [prev] | [next] | [standalone]


#25801

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2014-09-02 09:28 +0000
Message-ID<lu42k6$j87$1@dont-email.me>
In reply to#25799
On Tue, 02 Sep 2014 14:34:55 +1000, Andrew Poulos wrote:

> I'm confused. Is a stringified array of objects valid for json:

Looking at the syntax diagrams on json.org, yes.

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web