Open KamalSunar opened 1 month ago
Hi Kamal,
Connect GET uses the following query parameters:
message
: The request message, typically JSON or base64-encoded binary.base64=1
: Tells whether the message
is base-64 encoded.encoding
: Typically json
for JSON, and proto
for Protobuf binary.connect=v1
: Allows servers and proxies to distinguish Connect requests from other requests.If you use Protobuf binary (useBinaryFormat: true
in your transport), the base64=1
parameter is required, because binary data cannot be encoded in query parameters, and base64 makes it safe to encode.
If you use JSON (omit the useBinaryFormat
option in your transport), the base64
query parameter is not needed, and will not be included in the URL.
You can find the specification here.
You cannot remove these query parameters because they are required by the server to parse the request. You cannot add query parameters because the server will most likely not understand them, since they would not be part of the schema defined in Protobuf.
Hi,
I am using CRA with protobuf to generate proto files and adding generated proto query
export const getGenericList = { localName: "getGenericList", name: "getGenericList", kind: MethodKind.Unary, I: genericDetailsRequest, O: genericDetailsResponse, service: { typeName: "bfi.application_setting.rpc.ApplicationSettingService" } } as const;
while i am using this as
const { data } = useQuery({ ...getGenericList, idempotency: MethodIdempotency.NoSideEffects, // for GET method });
but whever i am calling an API, it adds other query params likeconnect: v1 encoding: octet-stream base64: 1 message: CgR0ZXN0
on url which i dont need.e.g https://**/v1/bfi.application_setting.rpc.ApplicationSettingService/getGenericList?connect=v1&encoding=octet-stream&base64=1&message=
how to pass custom query and use GET method on connect-query without autogenerated query params.