chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Returning JSON in Awful


From: David Ireland
Subject: [Chicken-users] Returning JSON in Awful
Date: Wed, 26 Sep 2018 15:13:14 +1000

Hi,

I've started using Awful 1.0 and having trouble returning a JSON string. The inverted commas are being replaced by &quot. For example, using the code below returns  {"a" : 1 }

Should this be normal behavior when returning JSON strings?

Thanks.
David

(use awful)                                                                                            
(enable-sxml #t)                                                                                       
                                                                                                       
(define my-json "{\"a\" : 1 }")                                                                        
                                                                                                       
(define (define-json path body)                                                                        
  (define-page path                                                                                    
    (λ ()                                                                                              
      (awful-response-headers '((content-type "text/json")))                                           
      (body))                                                                                          
    no-template: #t))                                                                                  
                                                                                                       
(define-json (main-page-path)                                                                          
  (λ () `(,my-json)))                                                                                  
                     

reply via email to

[Prev in Thread] Current Thread [Next in Thread]