[fix] shows error on non-existent file path; help message; removed accept-types header

This commit is contained in:
potato 2017-03-17 19:19:50 +01:00
parent 2d9dcc9303
commit fc372716b4

View File

@ -777,6 +777,11 @@ func (a *App) SubmitRequest(g *gocui.Gui, _ *gocui.View) error {
if len([]rune(postValues[i])) > 0 && postValues[i][0] == '@' { if len([]rune(postValues[i])) > 0 && postValues[i][0] == '@' {
file, err := os.Open(postValues[i][1:]) file, err := os.Open(postValues[i][1:])
if err != nil { if err != nil {
g.Execute(func(g *gocui.Gui) error {
vrb, _ := g.View(RESPONSE_BODY_VIEW)
fmt.Fprintf(vrb, "Error: %v", err)
return nil
})
return err return err
} }
defer file.Close() defer file.Close()
@ -1471,7 +1476,6 @@ func (a *App) ParseArgs(g *gocui.Gui, args []string) error {
arg_index += 1 arg_index += 1
form_str := args[arg_index] form_str := args[arg_index]
content_type = "multipart" content_type = "multipart"
accept_types = append(accept_types, config.ContentTypes["multipart"])
set_data = true set_data = true
vdata, _ := g.View(REQUEST_DATA_VIEW) vdata, _ := g.View(REQUEST_DATA_VIEW)
setViewTextAndCursor(vdata, form_str) setViewTextAndCursor(vdata, form_str)
@ -1627,7 +1631,7 @@ Other command line options:
-c, --config PATH Specify custom configuration file -c, --config PATH Specify custom configuration file
-h, --help Show this -h, --help Show this
-j, --json JSON Add JSON request data and set related request headers -j, --json JSON Add JSON request data and set related request headers
-F, --form DATA Adds multipart form request data and set related request headers -F, --form DATA Add multipart form request data and set related request headers
If the value starts with @ it will be handled as a file path for upload If the value starts with @ it will be handled as a file path for upload
-k, --insecure Allow insecure SSL certs -k, --insecure Allow insecure SSL certs
-R, --disable-redirects Do not follow HTTP redirects -R, --disable-redirects Do not follow HTTP redirects