我在使用代理的时候请求出错,我是用nginx做的代理请帮我看一下. #319
Unanswered
Soul-Journey
asked this question in
Q&A
Replies: 2 comments
-
可以使用 fiddler 抓一下 http client 的 request,看一下和 postman 的差异 |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think you may get more replies/comments on this if you also add an English translation to your post title. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
这是我的代码
builder.Services.AddOpenAIService(settings => { settings.ApiKey = AppSettings.AI.apiKey; }) .ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler { Proxy = new WebProxy(AppSettings.AI.Proxy), UseProxy = true } );
这是我nginx代理
`location /v1/ {
proxy_pass https://api.openai.com/v1/;
调用是 var modelList = await _openAIService.Models.ListModel();
错误是The proxy tunnel request to proxy '' failed with status code '400'.
但是我用postman调用没有问题
Beta Was this translation helpful? Give feedback.
All reactions