Reputation: 13607
I am trying to send a GET request through postman using file URI scheme. An example:
file:///absolute/path/to/file.txt
The request works properly in any browser, but postman
is failing with message:
Could not get any response
This seems to be like an error connecting to
file:///absolute/path/to/file.txt
Is there any way to make postman
work with file URIs?
Upvotes: 2
Views: 5422
Reputation: 186
In addition to czardoz's answer, for Python 3, SimpleHttpServer has been replaced by http.server. So, to serve the files using Python 3.x:
$ cd/path-to-directory/
$ python -m http.server 1234
Then, browse the file using:
http://localhost:1234/filename
Upvotes: 1
Reputation: 5767
I am not acquainted with SimpleHTTPServer, so I used live-server instead.
I followed the instructions at 2. Install and Run a Local Web Server to install live-server.
Then:
cd /path/to/(myJSONfile.json)
live-server <myJSONfile.json>
and the JSON file was opened in my default web browser.
http://127.0.0.1:8080
.It all worked just as intended.
Upvotes: 1
Reputation: 1147
Postman does not support file URIs, because the Chrome App platform does not allow direct access to files.
It should be easy to start a small HTTP server yourself though.. if you are on Mac/Linux, you can serve files in a directory using Python:
$ cd /path/to/directory/
$ python -m SimpleHTTPServer 1234
You can then visit
http://localhost:1234/filename
which will serve up the file.
Upvotes: 3