MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / HttpClient

Class HttpClient

tests/fixtures/sample.kt:6–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4data class Config(val baseUrl: String, val timeout: Int)
5
6class HttpClient(private val config: Config) {
7 fun get(path: String): String {
8 return buildRequest("GET", path)
9 }
10
11 fun post(path: String, body: String): String {
12 return buildRequest("POST", path)
13 }
14
15 private fun buildRequest(method: String, path: String): String {
16 return "$method ${config.baseUrl}$path"
17 }
18}
19
20interface Loggable {
21 fun log()

Callers 1

createClientFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected