fediglam/src/http/lib.zig

56 lines
1.2 KiB
Zig
Raw Normal View History

2022-06-09 06:37:09 +00:00
const std = @import("std");
const request = @import("./request.zig");
2022-10-13 09:23:57 +00:00
const server = @import("./server.zig");
2022-12-02 04:41:52 +00:00
pub const urlencode = @import("./urlencode.zig");
2022-10-16 12:48:12 +00:00
pub const socket = @import("./socket.zig");
2022-12-02 05:02:33 +00:00
const json = @import("./json.zig");
2022-12-03 07:44:27 +00:00
const multipart = @import("./multipart.zig");
2022-12-03 05:49:17 +00:00
pub const fields = @import("./fields.zig");
2022-10-16 12:48:12 +00:00
2022-12-03 09:00:04 +00:00
pub const Method = enum {
GET,
HEAD,
POST,
PUT,
DELETE,
CONNECT,
OPTIONS,
TRACE,
PATCH,
// WebDAV methods (we use some of them for the drive system)
MKCOL,
MOVE,
pub fn requestHasBody(self: Method) bool {
return switch (self) {
.POST, .PUT, .PATCH, .MKCOL, .MOVE => true,
else => false,
};
}
};
2022-07-09 22:43:35 +00:00
pub const Status = std.http.Status;
2022-11-18 02:42:23 +00:00
pub const Request = request.Request(server.Stream.Reader);
2022-10-13 09:23:57 +00:00
pub const Response = server.Response;
2022-12-02 05:02:33 +00:00
//pub const Handler = server.Handler;
2022-11-18 02:42:23 +00:00
pub const Server = server.Server;
2022-07-09 22:43:35 +00:00
2022-11-24 04:51:30 +00:00
pub const middleware = @import("./middleware.zig");
2022-12-03 05:49:17 +00:00
pub const Fields = fields.Fields;
2022-11-05 07:26:53 +00:00
2022-12-03 07:44:27 +00:00
pub const FormFile = multipart.FormFile;
2022-11-05 10:09:59 +00:00
pub const Protocol = enum {
http_1_0,
http_1_1,
http_1_x,
};
2022-12-02 05:02:33 +00:00
test {
_ = std.testing.refAllDecls(@This());
}