-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support non text responses #14
Comments
The simplest solution would probably be to implement a hotkey/shortcut/mode, which interprets the string specified in the "Body" Window as a path to a file (which then gets sent to the client, instead of the string). E.g.: Ctrl+f (or Ctrl+o)
-> Sends Content of |
That should probably work |
@jacksgt I'm working on this here: https://github.com/gchaincl/httplab/tree/respond-with-file, mind to take a look? |
@gchaincl Maybe I'm doing something wrong, but it doesn't (yet?) work for me: $ echo 'this is a test' > /tmp/test.txt
$ curl -i http://localhost:10080
HTTP/1.1 200 OK
X-Server: HTTPLab
Date: Sun, 05 Mar 2017 19:32:00 GMT
Content-Length: 0
Content-Type: text/plain; charset=utf-8
In |
Sorry I didn't explain how it works, make sure one of your responses in {
"Responses": {
"create": {
"Status": 201,
"Delay": 0,
"Body": "OK",
"File": "/tmp/test.txt",
"Headers": {
"X-Server": "HTTPLab"
}
}
}
} Then, open httplab, Ctrl+L, load the response and hit Ctrl+b to choose between input or file body. |
Implemented here: 157eba5 |
Awesome, just one more thing: It would be very nice to also support the home directory with Maybe even support for all environment variables is possible? ( |
that would be awesome, would you mind to open a new issue? |
Sure! #18 |
Only plain text responses are supported now, non text like binaries needs to be supported, this would probably involve changes on the UI as well.
The text was updated successfully, but these errors were encountered: