1
我的代碼:爲什麼我收到400錯誤的請求?
[DataContract(Namespace="http://yournamespace.com")
public class MyContract
{
[DataMember(Order=1)]
public string MyData1 { get(); set{};}
[DataMember(order=2)]
public string MyData2 { get(); set{};}
}
[WebInvoke(method="POST")]
public string DoSomethingFromPost(MyContract postedData)
{
String s="Success";
return s;
}
請求輸入:
<MyContract xmlns="http://yournamespace.com">
<MyData1>value</MyData1>
<MyData2>value</MyData2>
</MyContract>
雖然測試它在REST客戶端,我得到400錯誤的請求。 請告訴我如何測試Rest Client中的post方法,爲什麼我得到400個不好的請求。
請告訴我.........