LibHTTP 4
LibHTTP is a general perpose library for UnrealEngine2. It allows you to fetch files stored on webservers.Features:
- Support for HTTP version 1.0 and 1.1
- Support for GET/POST/HEAD/TRACE request methods
- Normal and accelerated transfer modes (accelerated mode creates a performance hit)
- Response and Request Header managent
- Cookie management
- Authentication supports (both Basic and Digest methods are supported)
- Support for HTTP proxies
- Gracefull handling of connection timeouts
- Automatic decoding of chunked data
- Automatically follows redirections (creates a redirection history)
- Support for
multipart/form-data
POST data (prefered form)
Download
The downloads include the binary .u file and the source. DO NOT recompile the source, use the binary, or else users can get a "modified package" error.- Version 4 [zip] (UT2004)
- Version 3.5.3 [zip] (UT2004)
- Version 3.5 [zip] (UT2004)
- Version 3 [zip] (UT2004)
- Version 2 [zip] (UT2004)
- Version 2 [zip] (UT2003)
- Version 1 [zip] (LGPL, UT2003)
License
Lesser Open Unreal Mod License Version 1.1, September 2005 0. Definitions "Program" the work, either in binary or source form, that has a notice attached to it stating that it has been released under this license it by the copyright holder. "Modification" a derivate of the Program or any other work based on the Program "Linking" using parts of the Program, or using parts of any other work, thus creating a direct dependency between two Programs. "You" the licensee "Runtime Environment" the virtual machine or operating system required to run the Program, as released by the Publisher or Creator of said runtime environment. This includes any extentions or updates for the runtime environment released by the Publisher or Creator. 1. License Herewith everybody is granted permission to copy and distribute verbatim copies of this document. The only restriction lies on changing the content, with the exception to translation of this license. This license applies to the Program that has been released under this license. The license only applies to copying, distribution and modification of the Program. Execution or output of the Program are not covered by this license, however the right for additional limitations on the use (that do not cover copying, distribution or modification) is granted to the copyright holder. This license is only valid when all terms in this license comply with the licenses of the dependecies of the Program. This includes the license of the possible required runtime environment. 2. Copying and distribution You are granted to copy or distribute verbatim copies of the Program, on any medium, or in any format as you see fit. You are not limited to charging a fee for the physical act of transferring the copy, nor are you limited to provide warranty for the Program in return of a fee. Unless this is prohibited by the license of the Runtime Environment. Any distribution of the program should be accompanied with a verbatim copy of this license. 3. Modification You are allowed to modify the Program, or portions of it, therefore making it a derivate of the Program. You are allowed to distribute your Modifications under the following conditions: - You must clearly state that it is a modification of the Program - The original copyright notice must be kept intact - The modified files must contain notices of the changes made to it - The Modification must be released under the same license as the Program - Distribution happens in compliance with section 2 4. Source The original source of the Program or Modification must be freely available on request. 5. Linking The license grants exclusive right to link with any non-free part of the Runtime Environment, as provided by the publisher or creator of said Runtime Environment. Using addapted portions of source code available in the runtime environment in the Program is only allowed under the following terms: - the addapted code is clearly marked to originate from the runtime environment, quoting the original copyright. - the following notice is added to the top of the file: "This file contains portions of code from the runtime environment." 6. NON WARRANTY THIS SOFTWARE DOES NOT COME WITH A WARRANTY OF ANY KIND, UNLESS NOTED OTHERWISE BY THE COPYRIGHT HOLDER OR WARRANTY PROVIDER. THE ENTIRE RISK OF THE PERFORMANCE AND QUALITY OF THE PROGRAM LIES WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU WILL ASSUME ALL COSTS FOR REQUIRED REPAIR OR CORRECTION.
UnrealEngine2 support
Version 2 has been developed using the UT2004 build of the UnrealEngine2 (UnrealEngine2.5). However, there's a big chance that this library also works on other UnrealEngine2 build without much additional work.If you are going to use this library on a diffirent build of the UnrealEngine2, please notify me (elmuerte at drunksnipers.com) so we can create a release version of that build.
Documentation
The documentation for this library can be created from the source using UnCodeX but it is also available on the UnrealWiki.Version history
New in version 200:- Supports HTTP 1.1
- Cached resolves
- Redirection history
- Chuncked encoding automatically decoded
- Added connection timeout
- More delegates
- bug fixes
- Improved easy of use: get(), post(), head()
- Support for
multipart/form-data
POST data - Two different transfer modes: Normal and Fast (tries to download as much data as allowed within a single tick)
- Support for proxy authentication, you get the best performance by setting the right user/pass in the beginning. Otherwise the code using this library will have to do additional processing when the proxy user and pass are not accepted.
- Better support for various authentication methods
- Support for digest authentication (more secure HTTP authentication). When digest is used instead of basic the client has to make 2 requests. With the first request the server will send information needed to construct the response. Basic authentication doesn't have this issue.
- Cookie storage class will automatically be created when
bProcCookies
orbSendCookies
is set to true (and the cookies hasn't been set)
- All delegates contains a HttpSock Sender argument
- New function string randString(optional int length, optional coerce string prefix)
- MultiPart divider string is now more unique (prevents potential issues with the content data)
- Empty multipart items are never added
- Made more support functions public
- New utility function string timestampToString(int timestamp, optional string Timezone, optional string format) that will convert a UNIX timestamp to a string (RFC 1123, RFC 1036, RFC 2822, ANSI C asctime formats supported)
- Fixed potentional issues with timestamps and cookies
- Various small bugfixes
- Redone the redirection processing, now with better support for each redirection type
- New variable
HttpSock.bRfcCompliantRedirect
, set this to false for the old, and bad, redirection handling on 301/302 headers (e.g. transform POST into GET) - Moved DNS caching to a global object, multiple HttpSock classes now use the same cache data
- Added automatic retrying when authentication data is provided in the url, the prefered method for using authenticated locations is to provide the username and password in the url or set them in the currenturl after the
OnRequireAuthorization()
was received. Can be disabled by settingHttpSock.bAutoAuthenticate
to false HttpSock.ClearRequestData()
will now automatically clear authentication information- NewsFeed properly reads CDATA
- NewsFeed description fields are truncated to 512 bytes (because of a bug in the engine). Set
NewsFeed.bSizeBugFix
to false to disable it. - URL parsing is now done by HttpUtil and stores it in a new xURL struct, all old references to storage of the location and host have been changed to xURL.
- Fixed a couple of bugs in cookie handler, the first cookie was never properly unset
- Fixed a bug where the last line of data may not be properly added to the result array
- Moved the HttpTest class to a UsUnit test suite
- Fixed
HttpSock.GetReturnHeader()
- Added a new class HttpCache that manages cached requests, this is somewhat experimental