gpt4 book ai didi

c# - Restsharp 异常无法识别 URI 前缀

转载 作者:太空宇宙 更新时间:2023-11-03 21:32:00 24 4
gpt4 key购买 nike

<分区>

我从 RestSharp The URI prefix is not recognized 得到一个异常,并且无法找出原因。

参数

requestBody 只是一个 POCO

domainsome.company.com

_config.AddPersonEndpointapi/person/add

public PersonResponse AddPerson(PersonRequest requestBody, string domain)
{
var client = new RestClient(domain);

var request = new RestRequest(_config.AddPersonEndpoint, Method.POST);
request.RequestFormat = DataFormat.Json;
request.AddBody(requestBody);

var response = client.Execute<PersonResponse>(request);

if (response.ErrorException != null)
throw response.ErrorException;

if (response.ErrorMessage != null)
throw new PortalConnectivityException(response.ErrorMessage);

if (!string.IsNullOrEmpty(response.Data.ErrorMessage))
throw new PortalException(response.Data.ErrorMessage);

return response.Data;

}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com