TestFlight의 업로드 API를 사용하여 빌드를 자동화하려고합니다. 여기에 자신의 문서입니다 : https://testflightapp.com/api/doc/WebRequest를 사용하여 TestFlight에 매개 변수 및 데이터 게시
이 내가 테스트 한 및 근무했던 미니멀 컬 명령 줄 요청입니다 :
var uploadRequest = WebRequest.Create("http://testflightapp.com/api/builds.json") as HttpWebRequest;
uploadRequest.Method = "POST";
uploadRequest.ContentType = "multipart/form-data";
var postParameters = string.Format("api_token={0}&team_token={1}¬es=autobuild&file=", TESTFLIGHT_API_TOKEN, TESTFLIGHT_TEAM_TOKEN);
var byteParameters = Encoding.UTF8.GetBytes(postParameters);
var ipaData = File.ReadAllBytes(IPA_PATH);
uploadRequest.ContentLength = byteParameters.Length + ipaData.Length;
var requestStream = uploadRequest.GetRequestStream();
requestStream.Write(byteParameters, 0, byteParameters.Length);
requestStream.Write(ipaData, 0, ipaData.Length);
requestStream.Close();
var uploadResponse = uploadRequest.GetResponse();
:
.\curl.exe http://testflightapp.com/api/builds.json
-F [email protected]
-F api_token='myapitoken' -F team_token='myteamtoken'
-F notes='curl test'
는이 같은 C 번호로 그 변환 해봤를
불행히도 GetResponse()
에 (500) Internal Server Error
이 표시되고 더 이상 정보가 없습니다.
내 postParameters의 데이터를 '
으로 래핑해야하는지 확실하지 않습니다. 두 가지 방법을 시도했습니다. 내 콘텐츠 유형이 맞는지 여부도 알 수 없습니다. 나는 또한 application/x-www-form-urlencoded
시도했지만 그 효과가 없었어요.
도움을 주시면 감사하겠습니다.
이렇게하면 도움이 될 것입니다. http://stackoverflow.com/questions/219827/multipart-forms-from-c-sharp-client 멀티 파트 요청이기 때문에 부품을 구별해야합니다. –
감사합니다. 흔적은 나를 restsharp에 데려 갔다, http://restsharp.org/, 나는 13 개의 whitespaced하게 된 선에서 요청을 실행하게했다! – tenpn