Bundle Lightweight embedded web server. Handles inbound HTTP requests with typed access to method, path, headers, and body; Response supports content-type, compression, redirects, and cookies. Compile with -lib net_server.
ContentType
Multipart content type
Operations
GetContent #
Get MIME content
method : public : GetContent() ~ Byte[]Return
| Type | Description |
|---|---|
| Byte | MIME bytes |
Example
parts := Web.Server.Request->ParseMultipartEncoding(request->ReadBody());
if(parts <> Nil & parts->Size() > 0) {
part := parts->Get(0);
data := part->GetContent();
data->Size()->PrintLine(); # byte count of uploaded data
};GetHeader #
Get MIME content header
method : public : GetHeader(name:String) ~ StringParameters
| Name | Type | Description |
|---|---|---|
| name | String | header name |
Return
| Type | Description |
|---|---|
| String | header value |
Example
parts := Web.Server.Request->ParseMultipartEncoding(request->ReadBody());
if(parts <> Nil & parts->Size() > 0) {
part := parts->Get(0);
disp := part->GetHeader("content-disposition");
disp->PrintLine(); # form-data; name="file"; filename="upload.txt"
};