... , or use Pat's JSON API to interact with the mailbox through the HTTP daemon (as the Web GUI does).
I believe the simplest solution would be to utilize Pat's JSON API to get/post messages serialized as JSON. That way, you could write the tool in the language of your choosing. This is what the Web GUI uses to talk to the daemon process, and the API can be considered fairly stable now.List of API routes: https://github.com/la5nta/pat/blob/master/http.go#L38Example of usage: https://github.com/la5nta/pat/blob/master/res/js/index.js#L411I'd be happy to go into more details on the JSON API if you decide to play with it.
Hello Jürgen,
root@jm:/home/jm# curl -Ssf http://localhost:8088/mailbox/in
curl: (7) Failed to connect to localhost port 8088: Verbindungsaufbau abgelehnt
--
You received this message because you are subscribed to the Google Groups "pat-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pat-users+unsubscribe@googlegroups.com.
To post to this group, send email to pat-...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pat-users/53b621ec-d94a-42b4-8dd2-e6973ca5e1e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Please provide the full log output from your Pat instance.
Am 21.11.17 um 22:17 schrieb LA5NTA:
> curl -Ssf http://localhost:8080/mailbox/in
Looking into the source: isn't an "api" missing at the front of the
URL-path?
Hi Jürgen
You may need to adjust your pat http call. I use
pat http -a 0.0.0.0:8080
So the socket is bound to any device and I can use pat in my whole LAN. Be careful that you don't make the port visible to the whole internet.
root@jm:/home/jm# pat http -a 0.0.0.0:8088
2017/11/22 12:51:32 Starting HTTP service (0.0.0.0:8088)...
curl -Ssf localhost:8088/api/mailbox/in
curl -Ssf 192.168.178.60:8088/api/mailbox/in
For now, your resources would be:
r.HandleFunc ("/ api / mailbox / ", postMessageHandler) .Methods ("POST")
r.HandleFunc ("/ api / posreport", postPositionHandler) .Methods ("POST")