-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from lucassklp/develop
Versão 1.2.0
- Loading branch information
Showing
35 changed files
with
723 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Rx.Http; | ||
using System; | ||
|
||
namespace Models.Consumers | ||
{ | ||
public class GoogleConsumer : RxConsumer | ||
{ | ||
public GoogleConsumer(IConsumerConfiguration<GoogleConsumer> configuration) : base(configuration) | ||
{ | ||
|
||
} | ||
|
||
public IObservable<string> GetGoogleContent() => Get(""); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Rx.Http; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Models.Consumers | ||
{ | ||
public class JsonPlaceHolderConsumer : RxConsumer | ||
{ | ||
public JsonPlaceHolderConsumer(IConsumerConfiguration<JsonPlaceHolderConsumer> configuration) : base(configuration) | ||
{ | ||
|
||
} | ||
|
||
public IObservable<List<Todo>> GetTodos() => Get<List<Todo>>("todos"); | ||
public IObservable<Identifiable> SendPost(Post post) => Post<Identifiable>("posts", post); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
|
||
namespace Models.Postman | ||
{ | ||
public class PostResponse : PostResponse<string> | ||
{ | ||
|
||
} | ||
|
||
public class PostResponse<T> | ||
{ | ||
[JsonProperty("args")] | ||
public Dictionary<string, string> Args { get; set; } | ||
|
||
[JsonProperty("data")] | ||
public T Data { get; set; } | ||
|
||
[JsonProperty("form")] | ||
public Dictionary<string, string> Form { get; set; } | ||
|
||
[JsonProperty("headers")] | ||
public Dictionary<string, string> Headers { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,28 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
|
||
namespace Models | ||
{ | ||
public class Todo | ||
public class Todo : IEquatable<Todo> | ||
{ | ||
public int userId { get; set; } | ||
public int id { get; set; } | ||
public string title { get; set; } | ||
public bool completed { get; set; } | ||
[JsonProperty("userId")] | ||
public int UserId { get; set; } | ||
|
||
[JsonProperty("id")] | ||
public int Id { get; set; } | ||
|
||
[JsonProperty("title")] | ||
public string Title { get; set; } | ||
|
||
[JsonProperty("completed")] | ||
public bool IsCompleted { get; set; } | ||
|
||
public bool Equals(Todo other) | ||
{ | ||
return this.Id == other.Id && | ||
this.IsCompleted == other.IsCompleted && | ||
this.Title == other.Title && | ||
this.UserId == other.UserId; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
|
||
namespace Rx.Http.Exceptions | ||
{ | ||
public class RxInvalidHeaderParameterException : Exception | ||
{ | ||
public RxInvalidHeaderParameterException() : base("The header key or value provided are invalid for http request.") | ||
{ | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#if NETSTANDARD2_0 | ||
|
||
using Microsoft.Extensions.DependencyInjection; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Rx.Http.Extensions | ||
{ | ||
public static class RxHttpLoggingExtension | ||
{ | ||
public static IServiceCollection AddRxHttpLogging<TLogging>(this IServiceCollection services) | ||
where TLogging : RxHttpLogging | ||
{ | ||
services.AddScoped<RxHttpLogging, TLogging>(); | ||
return services; | ||
} | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Rx.Http.Interceptors | ||
{ | ||
public interface RxRequestInterceptor | ||
{ | ||
void Intercept(RxHttpRequestOptions request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Net.Http; | ||
|
||
namespace Rx.Http.Interceptors | ||
{ | ||
public interface RxResponseInterceptor | ||
{ | ||
void Intercept(HttpResponseMessage response); | ||
} | ||
} |
Oops, something went wrong.