{"id":32394565,"url":"https://github.com/sofyan48/cumi","last_synced_at":"2026-07-11T08:31:06.366Z","repository":{"id":317828541,"uuid":"1068994567","full_name":"sofyan48/cumi","owner":"sofyan48","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-07T02:03:02.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-01T12:02:07.137Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sofyan48.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-03T08:32:12.000Z","updated_at":"2025-10-07T02:03:06.000Z","dependencies_parsed_at":"2025-10-06T09:03:14.352Z","dependency_job_id":null,"html_url":"https://github.com/sofyan48/cumi","commit_stats":null,"previous_names":["sofyan48/cumi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sofyan48/cumi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofyan48%2Fcumi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofyan48%2Fcumi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofyan48%2Fcumi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofyan48%2Fcumi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sofyan48","download_url":"https://codeload.github.com/sofyan48/cumi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofyan48%2Fcumi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35356473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-11T02:00:05.354Z","response_time":104,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-25T05:59:38.074Z","updated_at":"2026-07-11T08:31:06.360Z","avatar_url":"https://github.com/sofyan48.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cumi Http Requester\n\nA simple HTTP client library for Go\n## Installation\n\n```bash\ngo get github.com/sofyan48/cumi\n```\n\n## Quick Start\n### Basic GET Request\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"log\"\n    \"github.com/sofyan48/cumi\"\n)\n\nfunc main() {\n    client := cumi.NewClient()\n    resp, err := client.Http().Get(\"https://httpbin.org/get\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    \n    fmt.Println(\"Status:\", resp.Status)\n    fmt.Println(\"Response:\", resp.String())\n}\n```\n\n### SetSuccessResult - Auto JSON Parsing\n\nCompared to standard net/http which requires manual steps:\n\n```go\n// Traditional way with net/http\nresp, err := http.Get(\"https://api.example.com/users/1\")\nif err != nil {\n    return err\n}\ndefer resp.Body.Close()\n\nbody, err := io.ReadAll(resp.Body)\nif err != nil {\n    return err\n}\n\nvar user User\nerr = json.Unmarshal(body, \u0026user)\nif err != nil {\n    return err\n}\n```\n\n**With requester SetSuccessResult, it becomes much simpler:**\n\n```go\n// With requester - auto parsing!\nvar user User\nclient := cumi.NewClient()\nresp, err := client.Http().\n    SetSuccessResult(\u0026user).\n    Get(\"https://api.example.com/users/1\")\n\nif err != nil {\n    return err\n}\n\nif resp.IsSuccess() {\n    // user is already populated with data!\n    fmt.Printf(\"User: %+v\\n\", user)\n}\n```\n\n## Features\n\n- **SetSuccessResult/SetErrorResult** - Automatic response parsing\n- **Zero external dependencies** - Only uses Go standard library  \n- **Built-in retry mechanism** with configurable backoff\n- **Authentication support** - Basic Auth, Bearer Token, API Key\n- **Request/Response middleware** for logging and preprocessing\n- **File upload/download** with progress callbacks\n- **Debug mode** for request/response logging\n- **TLS configuration** for custom certificates\n- **Context support** for timeout and cancellation\n- **Form data and JSON** request bodies\n- **Query parameters and path parameters**\n- **Cookie management**\n- **Custom headers** per request or globally\n- **Tracing support** with OpenTelemetry integration\n\n## Examples\n\n### GET Request with Auto JSON Parsing\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"log\"\n    \"github.com/sofyan48/requester\"\n)\n\ntype User struct {\n    ID   int    `json:\"id\"`\n    Name string `json:\"name\"`\n    Email string `json:\"email\"`\n}\n\nfunc main() {\n    client := cumi.NewClient()\n    var user User\n    resp, err := client.Http().\n        SetSuccessResult(\u0026user).\n        Get(\"https://jsonplaceholder.typicode.com/users/1\")\n    \n    if err != nil {\n        log.Fatal(err)\n    }\n    \n    if resp.IsSuccess() {\n        fmt.Printf(\"User: %+v\\n\", user)\n    }\n}\n```\n\n### POST with JSON\n\n```go\nfunc main() {\n    client := cumi.NewClient()\n    user := User{Name: \"John\", Email: \"john@example.com\"}\n    \n    resp, err := client.Http().\n        SetBodyJSON(user).\n        Post(\"https://httpbin.org/post\")\n    if err != nil {\n        panic(err)\n    }\n    \n    fmt.Println(\"Status:\", resp.Status)\n    fmt.Println(\"Response:\", resp.String())\n}\n```\n\n### POST with Auto Result Binding\n\n```go\nfunc main() {\n    client := cumi.NewClient()\n    user := User{Name: \"John\", Email: \"john@example.com\"}\n    \n    // Auto result binding with SetSuccessResult\n    var result map[string]interface{}\n    resp, err := client.Http().\n        SetBodyJSON(user).\n        SetSuccessResult(\u0026result).\n        Post(\"https://httpbin.org/post\")\n    \n    if err != nil {\n        panic(err)\n    }\n    \n    if resp.IsSuccess() {\n        fmt.Printf(\"Received JSON: %+v\\n\", result[\"json\"])\n    }\n}\n```\n\n### Error Handling with SetErrorResult\n\n```go\ntype APIError struct {\n    Code    int    `json:\"code\"`\n    Message string `json:\"message\"`\n}\n\nfunc main() {\n    client := cumi.NewClient()\n    var user User\n    var apiError APIError\n    \n    resp, err := client.Http().\n        SetSuccessResult(\u0026user).\n        SetErrorResult(\u0026apiError).\n        Get(\"https://api.example.com/users/999\")\n    \n    if err != nil {\n        log.Fatal(err)\n    }\n    \n    if resp.IsSuccess() {\n        fmt.Printf(\"User: %+v\\n\", user)\n    } else {\n        fmt.Printf(\"API Error: %+v\\n\", apiError)\n    }\n}\n```\n\n### Client Configuration\n\n```go\nclient := cumi.NewClient().\n    SetBaseURL(\"https://api.example.com\").\n    SetTimeout(30*time.Second).\n    SetCommonHeader(\"Authorization\", \"Bearer your-token\").\n    SetRetryCount(3)\n\nvar users []User\nresp, err := client.Http().\n    SetSuccessResult(\u0026users).\n    Get(\"/users\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsofyan48%2Fcumi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsofyan48%2Fcumi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsofyan48%2Fcumi/lists"}