createRequest function
Implementation
http.Request createRequest(
Uri url, twirp.Context ctx, String applicationHeader) {
// setup request
final req = http.Request("POST", url);
// add headers from context
final headersFromCtx = twirp.retrieveHttpRequestHeaders(ctx) ?? {};
req.headers.addAll(headersFromCtx);
// add required headers
req.headers['Accept'] = applicationHeader;
req.headers['Content-Type'] = applicationHeader;
return req;
}