我得到以下关于使用 C# 使用 ORDS Oracle RESTful 数据服务的响应。
{ StatusCode: 405, ReasonPhrase: 'Method Not Allowed', 版本: 1.1, Content: System.Net.Http.StreamContent, Headers: { Content-Length: 11402 Content-Type: text/html } }
public void test()
{
string item_code;
using(var client = new HttpClient())
{
Item items = new Item
{
segment1 = "049002932",
description = "Fine Liner Dollar Pointer Softliner Metal Jacket F 0.3 Black 10's Box",
short_description = " Pointer F Black 10's Box", service_item = "No", primary_uom_code = "10", inventory_item_status_code = "Inactive"
};
client.BaseAddress = new Uri("http://10.132.1.40:8090/");
var response = client.PutAsJsonAsync("ords/ebsvis1/raz_inv/raz_item/Update/", items).Result;
if (response.IsSuccessStatusCode)
Console.Write("Success");
else
Console.Write("Error");
}
}
这是我的 RESTful 服务定义: