public void NoUrlSupplied() { HttpContentToSend content = new HttpContentToSend(); HttpRequestInfo requestInfo = new HttpRequestInfo(string.Empty, RequestType.Get, content); HttpRunner.SendHttpRequest(requestInfo); }
/// <summary> /// Gets a list of all the devices and their information from Device42 /// </summary> /// <returns>Json string of all the devices and their information</returns> /// <exception cref="RequestFailedException">The http request failed while trying to get the device list</exception> public override string Execute() { responseText = string.Empty; HttpRequestInfo requestData = null; requestData = new HttpRequestInfo( string.Concat(serverAddress, D42URLs.AllDevices) , RequestType.Get , authHeader ); try{ responseText = HttpRunner.SendHttpRequest(requestData); }catch (Exception excep) { throw new RequestFailedException("Request to get all devices failed", excep); } return(responseText); }
/// <summary> /// Gets a list of all the passwords and their information from Device42 /// </summary> /// <returns>Json string of all the passwords and their information</returns> /// <exception cref="RequestFailedException">The http request failed while trying to get the device list</exception> public override string Execute() { responseText = string.Empty; HttpRequestInfo requestData = null; requestData = new HttpRequestInfo( string.Concat(serverAddress, D42URLs.GetPasswords) , RequestType.Get , new HttpContentToSend(commandParameters, Encoding.UTF8, ContentType.GetForm) , authHeader ); // Reset commandParameters so the aren't reused commandParameters = string.Empty; try{ responseText = HttpRunner.SendHttpRequest(requestData); }catch (Exception excep) { throw new RequestFailedException("Request to get passwords failed", excep); } return(responseText); }