Write HTTP Server for API
Posted: Mon May 01, 2023 3:07 pm
Hi guys,
I've done a simple exe based on the example and ran it as a CGI In IIS. This works.
However, I'm trying to see if I can do a HTTP POST to it instead of just a GET. Or for that matter, other http requests type.
Here's the example I'm using.
What I'm trying to do is just have a HTTP Server running and then actioning stuff based on the paths provided. Much like gorilla/mux in golang.
https://github.com/gorilla/mux
I've done a simple exe based on the example and ran it as a CGI In IIS. This works.
However, I'm trying to see if I can do a HTTP POST to it instead of just a GET. Or for that matter, other http requests type.
Here's the example I'm using.
Code: Select all
If Not InitCGI() Or Not ReadCGI()
End
EndIf
WriteCGIHeader(#PB_CGI_HeaderContentType, "text/html", #PB_CGI_LastHeader) ; Write the headers to inform the browser of the content format
WriteCGIString("<html><title>PureBasic CGI</title><body>Test</body></html>")
https://github.com/gorilla/mux