• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Returning JSON
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Returning JSON


  • Subject: Re: Returning JSON
  • From: Hugi Thordarson <email@hidden>
  • Date: Thu, 18 Jun 2015 15:48:05 +0000

Hi Calven.

I’d programmatically create a response and return that, rather than create a separate component . Something like this (warning untested pseudocode):

public WOActionResults downloadJson() {
WOResponse response = new WORespnse();
response.setHeader( “application/json” );
response.setContentString( someStringContainingJSON );
return response;
}

Every JSON parser I have ever encountered defaults to UTF-8 (as they should, it’s part of the RFC) so you shouldn’t have to specify the encoding.

Cheers,
- hugi

// Hugi Thordarson
// http://www.loftfar.is/
// s. 895-6688


Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Returning JSON
      • From: Chuck Hill <email@hidden>
    • Re: Returning JSON
      • From: Hugi Thordarson <email@hidden>
References: 
 >Returning JSON (From: Calven Eggert <email@hidden>)

  • Prev by Date: Returning JSON
  • Next by Date: Re: Returning JSON
  • Previous by thread: Returning JSON
  • Next by thread: Re: Returning JSON
  • Index(es):
    • Date
    • Thread