anchor.diff:  % called for POST request
   known_content_type(ReqData, Context) ->
       ?PRINT(known_content_type),
  -    IsEmptyBody = (get_req_body(ReqData) =:= 'undefined'),
  +
  +    % NOTE: Webmachine returns <<>> as a body even if "Content-Length" header is
  +    % not present.
  +    Body = wrq:req_body(ReqData),
  +    ContentType = wrq:get_req_header("content-type", ReqData),
  +
       IsKnownType =
  -        case wrq:get_req_header("content-type", ReqData) of
  +        case ContentType of
               "application/json" -> true;
               "application/xml" -> true;
               "application/x-protobuf" -> true;
               % allow content-type to be undefined when the body is empty
  -            'undefined' when IsEmptyBody -> true;
  +            'undefined' when Body == <<>> -> true;
               _ -> false
           end,
  +
  +    % distinguish between "no body" and "empty body" cases: when communicating
  +    % using Protocol Buffers, empty body can appear when an empty list or an
  +    % empty record is sent as the input parameter
  +    RealBody =
  +        case Body of
  +            <<>> when ContentType == 'undefined' -> 'undefined'; % no body
  +            _ -> Body
  +        end,
  +    NewContext = Context#context{ request_body = RealBody },
  +
       % otherwise, return 415 Unsupported media type
  -    {IsKnownType, ReqData, Context}.
  +    {IsKnownType, ReqData, NewContext}.
   
   
   % Called for both GET and POST to find a match between provided content-types
  
positive.code:     RpcMod = Context#context.rpc_mod,
      ImplMod = Context#context.impl_mod,
  
      % make the actual call
      RpcResponse = RpcMod:rpc(ImplMod, FuncName, InputData, InputFormat, OutputFormat),
  
  
negative.code: content_type_to_format(_) -> 'undefined'.
  
  
  set_data_response(Data, OutputFormat, ReqData) ->
      wrq:set_resp_header(
          "Content-Type", format_to_content_type(OutputFormat),
  