[PR #1748] [API Client] Feature: Custom HTTP headers for every request #10658

Open
opened 2026-04-12 23:06:33 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/1748
Author: @secondtruth
Created: 12/30/2023
Status: 🔄 Open

Base: mainHead: patch-api


📝 Commits (8)

  • 3b781e5 Go API Client: Custom header for every request
  • 5d61ede Merge branch 'jmorganca:main' into patch-api
  • 0776226 Add comment for Header field
  • 94b5258 "User-Agent" header may not be overridden
  • ff72b0e Merge branch 'main' into patch-api
  • ff806c5 Merge branch 'ollama:main' into patch-api
  • fc4db2c Merge branch 'ollama:main' into patch-api
  • ff5334c Merge branch 'ollama:main' into patch-api

📊 Changes

1 file changed (+17 additions, -4 deletions)

View changed files

📝 api/client.go (+17 -4)

📄 Description

This pull request adds the ability to include a custom header to every request made by the Go API Client. The custom header is set using a new Header field in the Client struct.

This allows for more flexibility and customization when making requests to the API. My use case is setting an Authorization header to authenticate at my API proxy.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/1748 **Author:** [@secondtruth](https://github.com/secondtruth) **Created:** 12/30/2023 **Status:** 🔄 Open **Base:** `main` ← **Head:** `patch-api` --- ### 📝 Commits (8) - [`3b781e5`](https://github.com/ollama/ollama/commit/3b781e5004bb8978dba95a6fcb33b3601bcb6aed) Go API Client: Custom header for every request - [`5d61ede`](https://github.com/ollama/ollama/commit/5d61ede0665ab904b87a7b0dee51b2efa5488df6) Merge branch 'jmorganca:main' into patch-api - [`0776226`](https://github.com/ollama/ollama/commit/0776226e538bd892f5b2d0c10cfa207013493b34) Add comment for Header field - [`94b5258`](https://github.com/ollama/ollama/commit/94b52589d0b8132e07c17832a9c32dd084707d1c) "User-Agent" header may not be overridden - [`ff72b0e`](https://github.com/ollama/ollama/commit/ff72b0e1f0fe79a3475ccb6b95f6b3a0a37d1a7e) Merge branch 'main' into patch-api - [`ff806c5`](https://github.com/ollama/ollama/commit/ff806c505e634585240bb537f71743918947ffca) Merge branch 'ollama:main' into patch-api - [`fc4db2c`](https://github.com/ollama/ollama/commit/fc4db2c08469b38da045177104eb7d782f31173a) Merge branch 'ollama:main' into patch-api - [`ff5334c`](https://github.com/ollama/ollama/commit/ff5334c823c80f8460e8aee196faa9155fdc7a9c) Merge branch 'ollama:main' into patch-api ### 📊 Changes **1 file changed** (+17 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `api/client.go` (+17 -4) </details> ### 📄 Description This pull request adds the ability to include a custom header to every request made by the Go API Client. The custom header is set using a new `Header` field in the `Client` struct. This allows for more flexibility and customization when making requests to the API. My use case is setting an `Authorization` header to authenticate at my API proxy. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-12 23:06:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#10658