I have an application which hits APIs on the server. But the server isn't developed yet so I am using mock .json files on my local machine to proceed with client side development (which uses angularjs). Some of the APIs need to send POST requests (example: login). When I send POST requests to hit my mock .json files it gives me 400 status error. Is it possible to request .json file with Http Post method ?
I don't think you can use POST on local file only GET. One solution is to host your own server and mock from there. There are also website that help you do this for example Owllang
Related
I have a bunch of JSON files that I would like to grab in my React app through an API request. I know I can read and parse each JSON file, but eventually I would like to host these JSON files on the backend. I'm familiar with having a local server running and using that URL to make a request, but I'm not sure how to serve my JSON files on one server and make my API requests from the server that my React App is running on. Any recommendations or tips on how to start would be great!
I have developed a Node.js & Express Application that sends data as JSON.
Part of the application requires to send the Location of image files stored on different file servers (Windows Server 2012).
Currently the Node.js Application are delivering the file-location in a format like
[{"MulPfadS":"M:\\Originalbilder\\fos\\EID","MulDateiS":"EID00124","MulExtentS":"jpg","ObjId":178983}]
Now the customer wants the location of the file in a format like
http://10.9.0.11/path_to_image
There are no Webserver running on the file servers and the customer doesn't want to copy the image files from the file servers to the same server where the node.js application is running.
Is there a way to resolve this issue? And if so how?
You could convert the image as base64 encoded string and transfer across.
I have a Policy File service written in Node.js (Windows 7 environment). I simply want to test that the service returns the policy when a request is made over port 843, but without using Flash (i.e. Telnet, Browser, Powershell, Python, anything really.)
I've looked extensively but can't find any solution that does this. I have attempted with Telnet, but on connection, any keypress at all causes the server to return a bad response (presumably because the request didn't contain the requisite <policy-file-request/>\0 data.)
Is this possible?
You need to rebuild your service to wait for more data if there is incomplete data. Then you will be able to use Telnet to debug the service.
I am trying to put a json file on a localhost to call later on my app.
How do I put the Json file on to the Apache http server to call later?
I am new to Apache http server and back end in general, I am sorry if this question is ambiguous.
I tried to look up similar questions on stackoverflow..but I just could not find any.
Just put the File into your htdocs directory. You can access it by entering in your local Browser:
http://localhost/myfilename.json
Is it possible to push data to a local json file stored in my app folder using the $http service?
I've tried fiddling around with $http.post/.get and can't find a way to save/push new data into my local .json file.
Javascript is a client side program and therefore has no ability to modify files on your server (if you're just playing with directories on your local machine, for all intents and purposes, the local machine is your server.) Its only concern is client side logic. You need some type of server backend to do this.