|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Internet and Network > HTP. - Command > !HTP-General - General HTTP operations and utilities > !Configuration - Commands for setting up HTTP environment (timeouts, headers, proxy) > HTP. - HTTP Operations |
SPR Script Language
HTP.SetDebug
Enables or disables debug mode for HTTP operations.
Intention
The HTP.SetDebug command in SPR toggles debug mode for HTTP operations, controlling whether detailed diagnostic output is generated during requests like HTP.Request. When enabled ($$DEB=1), it activates verbose logging via X_AU statements; when disabled ($$DEB=0 or omitted), operations run silently.
Think of it as flipping a switch to peek under the hood of your HTTP robot—debug mode on for troubleshooting, off for quiet efficiency.
Illustration
🔍 Debug On: HTP.SetDebug|1 enables verbose output.
🤫 Debug Off: HTP.SetDebug (or HTP.SetDebug|0) disables it.
Syntax
HTP.SetDebug[|$$DEB]
Parameter Explanation
P1 - $$DEB - (Variable, Numeric, Optional)
Flag to enable or disable debug mode (e.g., $$DEB as "0" or "1"). If 0 or omitted, debug mode is turned off; if 1, debug mode is turned on, producing detailed output.
Examples
'***********************************
' HTP.SetDebug - Sample 1: Enable Debug Mode
'***********************************
HTP.SetDebug|1
MBX.Debug mode enabled - expect verbose output
HTP.Request|POST|https://api.example.com/data|{"key":"value"}
MBX.Ready
'
'***********************************
' HTP.SetDebug - Sample 2: Disable Debug Mode
'***********************************
HTP.SetDebug
PRT.Debug mode disabled - silent operation
HTP.Request|POST|https://api.example.com/data|{"key":"value"}
MBX.Ready
'
Remarks
- Sets the global g_Debugflag variable used by HTP_HTTPRequest to switch between debug and normal modes.
- Use $$DEB=1 for troubleshooting HTTP issues; $$DEB=0 or omitting it ensures minimal output.
- Debug output appears via X_AU, typically in a console or log.
Limitations
- Does not return a status; assumes the debug flag is set correctly.
- Debug output depends on HTP_Debug_HTTPRequest implementation.
See also: