Hi,
I want to write a wrapper for the GitHub API. I have never actually written
a wrapper before so I wanted to know if there is any specific design
methodology that we have to follow for writing a wrapper.
The Github API as I see returns a JSON object as the response after we send
a request to it. I tried writing a script for reading that response.

#lang racket

(require net/url)
(require json)

(define input
  (get-pure-port
   (string->url "https://api.github.com/users/some_username";)))
(define response (port->string input))
(close-input-port input)

(define x (string->jsexpr response))
(for (((key val) (in-hash x)))
  (printf "~a = ~a~%" key val))

Please tell me this method is correct or not? Is this how we start writing
a wrapper?

Thanks!
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to