Skip to content

Instantly share code, notes, and snippets.

@vasilevkin
Created May 4, 2019 10:44
Show Gist options
  • Save vasilevkin/a58cb29b2ccf482034dfed10781f9952 to your computer and use it in GitHub Desktop.
Save vasilevkin/a58cb29b2ccf482034dfed10781f9952 to your computer and use it in GitHub Desktop.
protocol HTTPClientService {
/**
Sends a 'get' request to a specified URL
- Parameter url: String of URL
- Returns: Optional observable Data type
*/
func get(url: String) -> Observable<Data?>
/**
Sends a 'post' request to a specified URL
- Parameter url: String of URL
- Parameter params: Json object data
- Returns: Optional observable response Data type
*/
func post(url: String, params: [String: Any]) -> Observable<Data?>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment