I have solved the problem thanks to help from another. The problem was that I was passing the request parameters in the URL without encoding them into json. For any that are looking to resolve this problem, here is the solution I arrived at with c#.
var httpWebRequest = ( HttpWebRequest )WebRequest.Create( "https://api.periscope.tv/api/v2/loginTwitter" );
httpWebRequest.ContentType = "application/json; charset=UTF-8";
httpWebRequest.Method = "POST";
using( var streamWriter = new StreamWriter( httpWebRequest.GetRequestStream() ) ){
string json = "{" +
""bundle_id":"com.bountylabs.periscope"," +
""phone_number":""," +
""session_key":""+final_oauth_token+""," +
""session_secret":""+final_oauth_token_secret+""," +
""user_id":""+user_id+""," +
""user_name":""+screen_name+""," +
""vendor_id":"81EA8A9B-2950-40CD-9365-40535404DDE4"" +
"}";
streamWriter.Write( json );
streamWriter.Flush();
streamWriter.Close();
}
var httpResponse = ( HttpWebResponse )httpWebRequest.GetResponse();
using( var streamReader = new StreamReader( httpResponse.GetResponseStream() ) ){
var result = streamReader.ReadToEnd();
display.Text = "cookie: "+result;
}
}
The result yields a cookie in the server's response.
Reference for more detail on this process: Twitter login POST request in Periscope API
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…