> On 11 Dec 2014, at 04:41, David Boeren <[hidden email]> wrote:
>
> That's the next line of code after what I quoted:
>
> "Parse the JSON data returned by the api"
> data := NeoJSONReader fromString: response.
>
> But, prior to the JSON parsing I was doing a couple of string replacements to patch up the data. The system I'm moving the data into doesn't accept accented characters or bullets, and it wants empty strings instead of nulls.
You can do the replacements after parsing too, just manipulating the generated data structures. I would say that is conceptually more correct.
> All the JSON stuff works fine. It's just the string operations with copyReplaceAll:with: that aren't working as expected for some reason.
>
> Or are you saying that the data I get from from asUrl retrieveContents is not a "proper string" and maybe that's why it's not working?
>
>
> On Wed, Dec 10, 2014 at 6:34 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>
> > On 10 Dec 2014, at 21:26, dboeren <[hidden email]> wrote:
> >
> > "Fetch the raw JSON data from dtdb.co"
> > response := 'http://dtdb.co/api/cards/' asUrl retrieveContents asString.
>
> Why no do
>
> NeoJSONReader fromString: 'http://dtdb.co/api/cards/' asUrl retrieveContents
>
> ?
>
> You'll get the data back, nicely parsed and converted to proper Pharo strings.
>
> Sven
>
Free forum by Nabble | Edit this page |