Skip to content

Commit

Permalink
Renamed RequestHeaders to HttpHeaders (closes #4)
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoboss committed Feb 9, 2024
1 parent a6abc8b commit ea1b810
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/kiota_abstractions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ part 'src/extensions/request_information_extensions.dart';
part 'src/http_method.dart';
part 'src/multipart_body.dart';
part 'src/request_adapter.dart';
part 'src/request_headers.dart';
part 'src/http_headers.dart';
part 'src/request_information.dart';
part 'src/request_option.dart';
part 'src/response_handler.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/extensions/request_information_extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extension RequestInformationExtensions on RequestInformation {
removeRequestOptions([option]);

/// Vanity method to add headers to the request.
void addHeaders(RequestHeaders headers) {
void addHeaders(HttpHeaders headers) {
headers.addAll(headers);
}

Expand Down
6 changes: 3 additions & 3 deletions lib/src/request_headers.dart → lib/src/http_headers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ part of '../kiota_abstractions.dart';
/// Represents the headers of a request.
///
/// Internally, this class uses a [Map] to store the headers.
class RequestHeaders implements Map<String, String> {
/// Creates a new instance of [RequestHeaders].
RequestHeaders();
class HttpHeaders implements Map<String, String> {
/// Creates a new instance of [HttpHeaders].
HttpHeaders();

final Map<String, String> _headers = {};

Expand Down
4 changes: 2 additions & 2 deletions lib/src/request_information.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ class RequestInformation {
/// The query parameters to use for the URL when generating the URI.
Map<String, dynamic> queryParameters;

final RequestHeaders _headers = RequestHeaders();
final HttpHeaders _headers = HttpHeaders();

/// The request headers.
RequestHeaders get headers => _headers;
HttpHeaders get headers => _headers;

/// The request body.
Uint8List content = Uint8List(0);
Expand Down
2 changes: 1 addition & 1 deletion test/request_information_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void main() {
expect(blank.urlTemplate, null);
expect(blank.pathParameters, <String, dynamic>{});
expect(blank.queryParameters, <String, dynamic>{});
expect(blank.headers, RequestHeaders());
expect(blank.headers, HttpHeaders());
expect(
blank.content,
isA<Uint8List>().having((content) => content.length, 'length', equals(0)),
Expand Down

0 comments on commit ea1b810

Please sign in to comment.