0
我在從C#發佈表單提交到KOBO服務器(https://kf.kobotoolbox.org)時遇到了一些麻煩。我得到的迴應是'壞門戶'。使用KOBO REST API提交表單提交
這裏是我的代碼:
var client = new RestClient("https://kc.kobotoolbox.org/api/v1/submissions");
//var client = new RestClient("https://kc.kobotoolbox.org/api/v1/forms/{pk}/labels");
client.Authenticator = new HttpBasicAuthenticator("a_user", "alpha9876");
//client.AddDefaultUrlSegment("pk", "31037");
//client.AddDefaultUrlSegment("tags", "tag1, tag2");
// client.AddDefaultUrlSegment("format", "xls");
//client.AddDefaultUrlSegment("url", "https://kc.kobotoolbox.org/api/v1/projects/1");
//client.AddDefaultUrlSegment("owner", "https://kc.kobotoolbox.org/api/v1/users/ona");
//client.AddDefaultUrlSegment("name", "project 1");
//client.AddDefaultUrlSegment("date_created", "2013-07-24T13:37:39Z");
//client.AddDefaultUrlSegment("date_modified", "2013-07-24T13:37:39Z");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
request.AddHeader("header", "xml");
request.Resource = "C:\\Users\\Susan\\Desktop\\xmltest\\form_linkage_parentform.xml";
任何人都可以使用的示例代碼段幫助什麼使這個POST HTTP請求可能會像C#代碼?基於此:https://kc.kobotoolbox.org/api/v1/
謝謝!
喜你能在這裏分享您的CSV文件格式? – Tirth