Change name of method, e.g.
string Get(string url, Guid id, bool logResponse)
Tuple<string, int> GetWithStatus(string url, Guid id, bool logResponse)
Main goal of programming is not to tell difference to compiler, but to tell difference to developers which will read your code. Another options is return status as out
parameter:
string Get(string url, Guid id, bool logResponse, out int status)
I do not like out
parameters very much, but I like tuples even less - what will tell name Item2
to developer which uses your method? Is it status, or retries count, or maybe response length? Neither method name, nor return type cannot say what is it.
So, even for first case with renamed method I'd also changed return type to something like
public class ServerResponse
{
public string Content { get; set; }
public HttpStatusCode Status { get; set; } // enum
// use this in first method to check if request succeed
public bool IsError
{
get { return (int)Status > 399; }
}
}