Skip to content

Commit

Permalink
Remove unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
TharmiganK committed Sep 20, 2024
1 parent 9967f74 commit 82c5e76
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
6 changes: 3 additions & 3 deletions ballerina/http_commons.bal
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ public isolated function parseHeader(string headerValue) returns HeaderValue[]|C
# };
#
# Headers headers = {apiVersion: "v1", id: 1};
# map<string|string[]> headersMap = http:getHeadersMap(headers); // { "X-API-VERSION": "v1", "id": "1" }
# map<string|string[]> headersMap = http:getHeaderMap(headers); // { "X-API-VERSION": "v1", "id": "1" }
# ```
#
# + headers - The headers represented as a map of anydata
# + return - A map of string or string array representing the headers
public isolated function getHeadersMap(map<anydata> headers) returns map<string|string[]> {
public isolated function getHeaderMap(map<anydata> headers) returns map<string|string[]> {
return map from var [key, value] in headers.entries()
select [getHeaderName(key, typeof headers), getHeaderValue(value)];
}
Expand Down Expand Up @@ -214,7 +214,7 @@ isolated function populateHeaders(Request request, map<string|string[]>? headers
return;
}

foreach var [headerKey, headerValue] in getHeadersMap(headers).entries() {
foreach var [headerKey, headerValue] in getHeaderMap(headers).entries() {
if headerValue is string[] {
foreach string value in headerValue {
request.addHeader(headerKey, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import io.ballerina.runtime.api.values.BTypedesc;
import io.ballerina.stdlib.http.api.HttpConstants;
import io.netty.handler.codec.http.HttpResponseStatus;
import io.netty.util.internal.StringUtil;

import java.util.Objects;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,18 @@

package io.ballerina.stdlib.http.api.service.signature;

import io.ballerina.runtime.api.creators.ValueCreator;
import io.ballerina.runtime.api.types.Field;
import io.ballerina.runtime.api.types.RecordType;
import io.ballerina.runtime.api.types.Type;
import io.ballerina.runtime.api.utils.StringUtils;
import io.ballerina.runtime.api.utils.TypeUtils;
import io.ballerina.runtime.api.utils.ValueUtils;
import io.ballerina.runtime.api.values.BError;
import io.ballerina.runtime.api.values.BMap;
import io.ballerina.runtime.api.values.BString;
import io.ballerina.stdlib.constraint.Constraints;
import io.ballerina.stdlib.http.api.HttpUtil;
import io.ballerina.stdlib.http.api.nativeimpl.ExternUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;

import static io.ballerina.runtime.api.TypeTags.RECORD_TYPE_TAG;
import static io.ballerina.stdlib.http.api.HttpConstants.ANN_NAME_HEADER;
Expand Down

0 comments on commit 82c5e76

Please sign in to comment.