accept moon or json

master
Jordan Orelli 9 years ago
parent ea66a11355
commit 9aaeccccee

@ -51,16 +51,16 @@ func (r *repl) run() {
continue continue
} }
doc, err := moon.Read(&body_in) var body_json []byte
if err != nil { doc, err := moon.ReadBytes(body_in.Bytes())
r.errorf("moon parse error: %v", err) if err == nil {
continue body_json, err = doc.MarshalJSON()
} if err != nil {
r.errorf("moon to json encode error: %v", err)
body_json, err := doc.MarshalJSON() continue
if err != nil { }
r.errorf("moon to json encode error: %v", err) } else {
continue body_json = body_in.Bytes()
} }
// compose http request // compose http request

Loading…
Cancel
Save