Identify if URL points to PiCoWebserver or to "normal" web service from Plantuml?

0 votes
asked Aug 16 in Question / help by rkrug (400 points)
commented Aug 16 by Rainer
I was not able to enter any text in the question...

SO: I have an R function which generates the url to generate the graph. I woyld like to automate the checking of the types supported by querying the URL. Is this possible?

1 Answer

0 votes
answered Aug 17 by plantuml (279,640 points)

A possible option is to check HTTP headers sent back by the server. If it contains Server: PlantUML PicoWebServer then, it's a PicoWebServer.

Does it help?

commented Aug 17 by rkrug (400 points)

Hm. Sounds doable - but I do not know much about http and web servers...

As the reason I would like to know this is to identify the supported formats, would it be possible to add a document which contains the supported formats? Something along the lines of http://server:port/supportedformats which returns text of json containing the supported formats and other relevant info?

commented Aug 17 by plantuml (279,640 points)

Sure, this http://server:port/supportedformats endpoint is a good idea.

The most complex part is to defined what will be in the actual json data :-)

To start, I suggest that you give us the data you are expecting for "PicoWebServer".

We will then hardcode this in the endpoint http://server:port/supportedformats for "PicoWebServer".

This should be easy to implement.

commented Aug 17 by rkrug (400 points)

Great. The information I would need, is at the moment only the supported formats, as I think that is the only difference in the servers? i.e. there is nothing else that differs between a call to the web server or the PicoWebServer.

probably in a different endpoint, the version of plantuml used would also be useful to know in some cases. So the endpoint could be named http://server:port/serverinfo and one entry could be the supported formats. Another one the server type (PicoWebServer or web service) the version, etc.

commented Aug 17 by rkrug (400 points)
Oh - supported formats and the code used in the call "server:port/FORMAT_CODE/ENCODED_GRAPH
commented Aug 23 by rkrug (400 points)
Any news on this? I just continued working  the package where this would be extremely useful.
commented Aug 23 by plantuml (279,640 points)
Yes, we will implement something here.

However, please be patient: we are also working on other subjects and this is not our top priority. I think that a first release will be done before end of September.
commented Aug 23 by rkrug (400 points)
Thanks - fine with me. End of September is fine.
commented Aug 24 by plantuml (279,640 points)
With last snapshot PicoWeb is now sending some information when calling localhost:8000/serverinfo or localhost:8000/plantuml/serverinfo

This is really a first draft so tell us if it is what you are expecting.
commented Aug 25 by rkrug (400 points)
Brilliant - that contains all the info I need at the moment.

Thanks a lot.

I will inform you when the R package is ready and you can add it to your section.
commented Aug 31 by rkrug (400 points)
I assume this will be deployed in the September release as the stop server feature?

Do you have any idea when it will be in the PlantUML Web Server available?