In version 3.0.1, virtually every major component has been overhauled to make RESTful web services even easier to create and debug. Just read on...
Introduced in v3.0.0, the HTTP Framework Setup form (NDW_HTTP_FRAMEWORK_SETUP) form includes more options:
Logging is a critical tool in the belt when troubleshooting and profiling web services. In the last release we updated the Response log to include useful metadata. In 3.0.1, we go full throttle with the logging enhancements.
Request Logs - Once upon a time the Request logs were nothing but raw text dumps of the Request argument that the OECGI passed into HTTP_MCP. We are now proud to showcase our new and improved Request log format:
Request Argument -------------------------------------------------------------------------------- <01> HTTPQueryString : <02> HTTPPathInfo : contacts <03> HTTPContentType : <04> HTTPContentLength : 0 <05> HTTPGatewayInterface : CGI/1.1 <06> HTTPHTTPS : off <07> HTTPAccept : */* <08> HTTPCookie : <09> HTTPFrom : <10> HTTPReferer : <11> HTTPUserAgent : PostmanRuntime/6.1.6 <12> HTTPTranslated : C:\MyWebsite\www\contacts <13> HTTPRemoteAddr : 127.0.0.1 <14> HTTPRemoteHost : <15> HTTPRemoteIdent : <16> HTTPRemoteUser : <17> HTTPRequestMethod : GET <18> HTTPScriptName : /cgi-bin/oecgi4.exe <19> HTTPServerName : www.contacts.com <20> HTTPServerPort : 80 <21> HTTPServerProtocol : HTTP/1.1 <22> HTTPServerSoftware : Abyss/2.9.3.6-X1-Win32 AbyssLib/2.9.3.6 <23> HTTPServerURL : <24> HTTPNoURLDecode : <25> HTTPResponseIsBinary : <26> HTTPRegistrySettings + RegistryInfo : SOFTWARE\RevSoft\OECGI4 EngineName : ServerURL : localhost ServerPort : 8088 ApplicationName : FRAMEWORKS UserName : FRAMEWORKS StartupFlags : 1 ShutdownFlags : 1 FilePath : FilePathMapped : FileMode : 1 SysDownPage : OILocation : AdditionalValues : HTTP_MEDIA_TYPE,HTTP_ACCEPT_ENCODING,HTTP_ACCEPT_CHARSET,HTTP_ACCEPT_LANGUAGE,HTTP_AUTHORIZATION <27> HTTPOECGIVersion : VERSION:OECGI4 <28> HTTPGetString : <29> HTTPPostString : <30> HTTPAdditionalValues + Media-Type : Accept-Encoding : gzip, deflate Accept-Charset : Accept-Language : Authorization : |
Response Logs - Turns out more metadata is a good thing so we went ahead and updated the Response log with the current HTTP Framework version, Authorization information, and Query Params used.
Aborted Logs - We added a new log type for aborted web services to make it easy to identify the offending code:
ProcErr Argument -------------------------------------------------------------------------------- ENG0010: HTTP_CONTACTS_SERVICES, line 315. Variable has not been assigned a value. |
Version 3.0.0 introduces new features to make it easier to configure setup values and to accept special URLs without requiring authentication.
This form can be used to configure all setup parameters without the need to edit the SRP_HTTP_FRAMEWORK_SETUP record directly.
A new setup parameter has been created to store one or more URLs that should pass through the authentication logic. The HTTP_Authentication_Services module has been updated to verify if the URL requires authentication. If not, the current URL request is marked as authenticated so it can continue to be processed by the end point API.
This feature is helpful when OAuth-type requests need to be supported. OAuth relies upon communication between trusted servers, away from client-side web and mobile applications. This is part of the security mechanism of OAuth. Generally, these URLs cannot be configured to support server-side authentication so these need to be allowed through without authentication.
The logging feature of HTTP_MCP has been updated to provide more useful information in the response log. In addition to the basic response information (e.g., status code, response headers, and the body), metadata for the URL request itself is added so that it is easier to match the request to the response. Additionally, the time to execute the request from start to finish is also included as a way of helping developers identify potential bottlenecks. Here is an example of an updated response log:
Time to Execute: 00h 00m 00s 875ms Request Method : POST Request URL : https://api.srpcs.com/srpteam/users/don -------------------------------------------------------------------------------- Status: 201 Created Access-Control-Allow-Origin: * Content-Type: application/hal+json Content-Length: 129 { "URL" : "https://api.srpcs.com/srpteam/users/don", "method" : "POST", "phrase" : "Created", "status" : 201 } |