4D Blog

Home Product Latest Improvements of the HTTP Client

Latest Improvements of the HTTP Client

October 18, 2022

Product

With 4D v19R6, we brought you a new way to perform HTTP requests: HTTP classes. At that time, some of the HTTP classes functionalities were not final, as we wanted to adapt them to the new syntax. It is now done! In v19R7, compressed responses, chunked responses, and redirections functionalities are now complete.

As a bonus, we also added a new way to log HTTP requests. And as it’s helpful to everyone, this new logging is available to the new HTTP classes as well as for the legacy syntax.

First of all, let me speak about the HTTP classes’ functionalities. We have reported and adapted the legacy syntax functioning to fit the new syntax. We include most of its features, namely HTTPs, proxy and server authentication, redirections, chunked responses, and compressed responses. We also added a few functionalities, like the ability to cancel a request or the new logging of HTTP client requests (I’ll come to this in the next paragraph). The last functionality we need to report in the new syntax is the connection persistence through a keep-alive: it will come soon inside a much more prominent feature… that I’ll explain to you in another blog post. Stay tuned!

Now, let’s discuss the new HTTP client logging available in v19R7.
Activating the HTTP client logging is extremely simple; you just have to add this line to your code:

HTTP SET OPTION(HTTP client log; HTTP enable log with all body parts)

And that’s it! All your requests and responses will be logged in the 4DHTTPClientLog_x.txt file in the Logs directory with the same format as the server logs.

Of course, you can log requests and responses entirely, but if you don’t want your log files cluttered with long responses, you can remove the response bodies and even the request bodies. The syntax is extremely close to the server log activation, so you won’t be surprised.

Lastly, here is an example of a request and its response (without their bodies) logged into the HTTP client log file:

# REQUEST
# SequenceID: 7
# ConnectionID: DDF30D20070B0848B455971A0D627ED6
# LocalIP: 192.168.18.11:52097
# PeerIP: 192.168.4.7:3128
# TimeStamp: -1607148967
GET http://www.4d.com:80/ HTTP/1.1
Accept-Encoding: gzip, deflate
Connection: Close
Content-Length: 4
Content-Type: text/plain; charset=UTF-8
Date: Fri, 23 Sep 2022 09:30:58 GMT
Host: www.google.com
User-Agent: 4D_HTTP_Client/0.
[Body Size: 4]

# RESPONSE
# SequenceID: 6
# ConnectionID: 8EA22B111F16B04B92966DEFAA22704F
# LocalIP: 192.168.18.11:52090
# PeerIP: 192.168.4.7:3128
# TimeStamp: -1607191491
# ElapsedTimeInMs: 154
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Connection: close
Content-Encoding: gzip
Content-Length: 6185
Content-Type: text/html; charset=ISO-8859-1
Date: Fri, 23 Sep 2022 09:30:16 GMT
Expires: -1
Via: 1.1 proxy-squid (squid/3.5.27)
[Body Size: 6185]

If you have any comments regarding this new feature, feel free to share them with us on the official 4D forum.

Discuss

Tags HTTP, Programming, v19 R7, v20

Latest related posts

  • November 14, 2025

    Event Report in 4D Qodly Pro: See Every Interactions at a Glance

  • November 14, 2025

    4D Qodly Pro: Page Zoom Controls

  • November 13, 2025

    macOS Tahoe, Windows 11, which operating systems for 4D 20 and 21?

Nicolas Brachfogel
Nicolas Brachfogel
Product Owner & Senior Developer - Nicolas Brachfogel joined 4D in 2017 as senior developer (4D Server and networking) and as Product Owner to manage the 4D version on Apple Silicon. He is tasked with the redaction of user stories and functional specifications, as well as the verification that the new features are in line with customers' needs. With a degree from Institut Supérieur d'Informatique Appliquée Paris (INSIA), Nicolas started his career as a software developer in 2001. After many years of development in Java and C++, he specialized himself in client-server development in the video game industry. As a developer/software architect, he worked on the server architectures of many games (Dofus Arena, Drakerz, Trivial Pursuit Go !).
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • AI
  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy