forked from Mirror/ollama4j
		
	Updated all APIs to use getRequestBuilderDefault() method
				
					
				
			This commit is contained in:
		
							
								
								
									
										24
									
								
								docs/docs/apis-extras/basic-auth.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								docs/docs/apis-extras/basic-auth.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
---
 | 
			
		||||
sidebar_position: 2
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
# Set Basic Authentication
 | 
			
		||||
 | 
			
		||||
This API lets you set the basic authentication for the Ollama client. This would help in scenarios where
 | 
			
		||||
Ollama server would be setup behind a gateway/reverse proxy with basic auth.
 | 
			
		||||
 | 
			
		||||
After configuring basic authentication, all subsequent requests will include the Basic Auth header.
 | 
			
		||||
 | 
			
		||||
```java
 | 
			
		||||
public class Main {
 | 
			
		||||
 | 
			
		||||
    public static void main(String[] args) {
 | 
			
		||||
 | 
			
		||||
        String host = "http://localhost:11434/";
 | 
			
		||||
 | 
			
		||||
        OllamaAPI ollamaAPI = new OllamaAPI(host);
 | 
			
		||||
 | 
			
		||||
        ollamaAPI.setBasicAuth("username", "password");
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
		Reference in New Issue
	
	Block a user