I see a lot of similar code in https://github.com/loopj/android-async-http/pull/339/files#diff-b7642d6783234c023a733a2f1dd10599R54
May this be merged, so it won't duplicate?