Declared the Endpoint protocol and the HTTPRequestMethod enumeration.
This commit is contained in:
parent
30b84f735b
commit
e1e5a9a36d
@ -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"
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
public struct Libraries {
|
||||
public private(set) var text = "Hello, World!"
|
||||
|
||||
public init() {
|
||||
}
|
||||
}
|
@ -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 }
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user