[fix] add formatter to request right after initialization

pull/94/head
Adam Tauber 7 years ago
parent 7bfcc6e947
commit 974f00be4e

@ -863,6 +863,8 @@ func (a *App) SubmitRequest(g *gocui.Gui, _ *gocui.View) error {
r.RawResponseBody = bodyBytes
}
r.Formatter = formatter.New(a.config, r.ContentType)
// add to history
a.history = append(a.history, r)
a.historyIndex = len(a.history) - 1
@ -918,10 +920,6 @@ func (a *App) PrintBody(g *gocui.Gui) {
vrb.Clear()
var responseFormatter formatter.ResponseFormatter
if req.Formatter == nil {
req.Formatter = formatter.New(a.config, req.ContentType)
}
responseFormatter = req.Formatter
vrb.Title = VIEW_PROPERTIES[vrb.Name()].title + " " + responseFormatter.Title()

Loading…
Cancel
Save