mirror of
https://github.com/safishamsi/graphify.git
synced 2026-07-13 19:07:10 +00:00
81a43f028f
Java, C, C++, Ruby, C#, Kotlin, Scala, PHP via tree-sitter (13 total) benchmark.py measures BFS subgraph tokens vs corpus tokens 5 skill bug fixes (cohesion crash, dead step, missing MCP tool)
24 lines
520 B
Scala
24 lines
520 B
Scala
import scala.collection.mutable.ListBuffer
|
|
|
|
case class Config(baseUrl: String, timeout: Int)
|
|
|
|
class HttpClient(config: Config) {
|
|
def get(path: String): String = {
|
|
buildRequest("GET", path)
|
|
}
|
|
|
|
def post(path: String, body: String): String = {
|
|
buildRequest("POST", path)
|
|
}
|
|
|
|
private def buildRequest(method: String, path: String): String = {
|
|
s"$method ${config.baseUrl}$path"
|
|
}
|
|
}
|
|
|
|
object HttpClientFactory {
|
|
def create(baseUrl: String): HttpClient = {
|
|
new HttpClient(Config(baseUrl, 30))
|
|
}
|
|
}
|