Declared the Endpoint protocol and the HTTPRequestMethod enumeration.

This commit is contained in:
Javier Cicchelli 2023-04-10 13:12:28 +02:00
parent 30b84f735b
commit e1e5a9a36d
3 changed files with 32 additions and 6 deletions

View File

@ -0,0 +1,12 @@
//
// HTTPRequestMethod.swift
// APICore
//
// Created by Javier Cicchelli on 10/04/2023.
// Copyright © 2023 Röck+Cöde. All rights reserved.
//
/// Enumeration that represents the available HTTP request methods to use in this library.
public enum HTTPRequestMethod: String {
case get = "GET"
}

View File

@ -1,6 +0,0 @@
public struct Libraries {
public private(set) var text = "Hello, World!"
public init() {
}
}

View File

@ -0,0 +1,20 @@
//
// Endpoint.swift
// APICore
//
// Created by Javier Cicchelli on 10/04/2023.
// Copyright © 2023 Röck+Cöde. All rights reserved.
//
import Foundation
/// This protocol defines an endpoint to be used in an API call.
public protocol Endpoint {
var scheme: String { get }
var host: String { get }
var port: Int? { get }
var path: String { get }
var method: HTTPRequestMethod { get }
var headers: [String: String] { get }
var body: Data? { get }
}