orbit-db-http-api icon indicating copy to clipboard operation
orbit-db-http-api copied to clipboard

How to Access Over Internet

Open spriyabalan opened this issue 3 years ago • 2 comments

Instead of calling from command prompt as curl -X GET https://localhost:3000/identity i want to call it from my application through rest API. say for example from Postman. how can i do that. Assuming my hostname is abc.xyz.com i am trying it in postman as https://abc.xyz.com:3000/identity its giving 500 internal server error

spriyabalan avatar Nov 19 '21 10:11 spriyabalan

Please see that there is no issue related to the source. (the question is too width) Anyway it's a question - i'll try to answer and You also should if You have found a solution. Postman is not the best option to test more complicated API If You want to access to beta services via application (Your app) 0. (obvious) Have server accessible on public address and open port - SSL/ Proxy etc. (eg. nginx with certboot there is a lot of tutorials)

  1. You must see/analyze the header and body (both req/resp) for that service so !LOCALLY! switch off ssl and use http (not https) and then
  2. Use CURL with [ --trace - ]parameter to see header and body on both sides.
  3. Implement the same structure You see on CURL to You APP and have a fun.

There is one point to raise according to that lib; When You start a service use [--http1 ] parameter I have spend some time to realize that there is a problem with http2 and still not sure if the problem is on lib side or on my server/proxy/etc.

Nortberg avatar Dec 23 '21 08:12 Nortberg

If you have a 500 error it should display the cause in the api server console. If you can post some logs here it might be possible to track down what's not working

phillmac avatar Dec 23 '21 11:12 phillmac