Skip to content

GRPC request body is not recognized by grpc service #407

Closed
@AnWeber

Description

Discussed in #403

Originally posted by smaktacular February 28, 2023
Hi,

please consider the following proto:

syntax = "proto3";
import "messages.proto";
package testpackage;
option csharp_namespace = "TestServices";

service TestService {
	rpc Echo (StringRequest) returns (StringResult);
}

message StringRequest {
  string str = 1;
}

message StringResult {
  string str = 1;
}

with the following c# implementation:

        public override Task<StringResult> Echo(StringRequest request, ServerCallContext context)
        {
            return Task.FromResult(new StringResult { Str = request.Str });
        }

using grpcurl

grpcurl.exe -d '{ "str": "string" }' -proto .\services.proto --plaintext localhost:4711 testpackage.TestService/Echo

I get

{
  "str": "string"
}

but using httpyac

proto < ./services.proto


### Test
GRPC {{hostname}}:{{port}}/testpackage.TestService/Echo
{
  "str": "string"
}

I get

GRPC 0 OK
content-type: application/grpc
date: Tue, 28 Feb 2023 09:17:18 GMT
server: Kestrel

{}

While Debugging the request from httpyac I can see that the property (str) in the body is not recognized. Does anyone have an idea what would cause this difference in the two results?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions