Skip to content

http访问外部api时程序崩溃退出 #3

@egsoftcn

Description

@egsoftcn

try { PageContent = await _http.GetStringAsync("https://localhost/"); } catch (Exception ex) { Console.WriteLine(ex.Message); };
这这么一段代码,如果访问api地址是localhost程序正常不会崩溃,如果地址是外部api地址,比如https://webapi.mysite.com/就直接崩溃退出。没有任何提示,日志也没有啥有用的信息。问了ai也不清楚什么问题。
请问这是哪里的问题?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions