Add Network Operations to Standard Library#8
Conversation
Add DownloadFile and HttpGet functions using fphttpclient unit. - Add fphttpclient to uses clause in uHeatherLib.pas - Implement DownloadFile: downloads file from URL to local path - Implement HttpGet: performs HTTP GET request and returns response body - Register both functions in heather.pas OnCompile method - Add test_network.pas demonstrating usage Resolves urban233#1
|
Hi there! Thanks so much for putting this together. Adding network operations is a fantastic step for HEATHER—it really opens up a lot of possibilities for automation. I took the branch for a spin and did a quick review. The core logic looks solid, but I found a few small things that need a little bit more work before we can merge this in. 1. Small adjustment in
|
Summary
This PR adds network operations to HEATHER's standard library, implementing the features requested in Issue #1.
Changes
New Functions Added
DownloadFile(const URL, Dest: string): Boolean- Downloads a file over HTTP/HTTPS to the specified destinationHttpGet(const URL: string): string- Performs a GET request and returns the response body as a stringImplementation Details
fphttpclientunit touHeatherLib.pasfor native HTTP supportTFPHTTPClientfrom Free Pascal'sfphttpclientunitheather.pasOnCompilemethod for script accesstest_network.pasdemonstrating usage of new functionsAcceptance Criteria Met
✅
DownloadFilefunction implemented✅
HttpGetfunction implemented✅ Uses native Free Pascal units (
fphttpclient)✅ Both functions registered in
THeatherEngine.OnCompile✅ Test script added demonstrating usage
Testing
The test script
test_network.pascan be run with:It demonstrates:
HttpGetto fetch webpage contentDownloadFileto download a fileResolves #1