internal static void SetupProtocolRequest(QueryExpression expression, IODataRequestManager requestManager, IQueryToODataPayloadConverter queryToPayloadConverter, ODataUri uri, HttpHeaderCollection headers, string actionContentType, out Contracts.OData.ODataRequest request) { HttpVerb requestVerb = HttpVerb.Get; if (uri.IsAction()) { requestVerb = HttpVerb.Post; } if (uri.IsWebInvokeServiceOperation()) { requestVerb = HttpVerb.Post; } request = requestManager.BuildRequest(uri, requestVerb, headers); if (uri.IsAction()) { var procedurePayload = queryToPayloadConverter.ComputePayload(expression) as ComplexInstance; if (procedurePayload != null) { request.Headers.Add(HttpHeaders.ContentType, actionContentType); FixupAddingResultWrappers(actionContentType, procedurePayload); // TODO: Need to understand if product allow an Html form even if no parameters specified request.Body = requestManager.BuildBody(actionContentType, uri, procedurePayload); } } }
internal static void SetupProtocolRequest(QueryExpression expression, IODataRequestManager requestManager, IQueryToODataPayloadConverter queryToPayloadConverter, ODataUri uri, HttpHeaderCollection headers, string actionContentType, out Contracts.OData.ODataRequest request) { HttpVerb requestVerb = HttpVerb.Get; if (uri.IsAction()) { requestVerb = HttpVerb.Post; } if (uri.IsWebInvokeServiceOperation()) { requestVerb = HttpVerb.Post; } request = requestManager.BuildRequest(uri, requestVerb, headers); if (uri.IsAction()) { var procedurePayload = queryToPayloadConverter.ComputePayload(expression) as ComplexInstance; if (procedurePayload != null) { request.Headers.Add(HttpHeaders.ContentType, actionContentType); FixupAddingResultWrappers(actionContentType, procedurePayload); // TODO: Need to understand if product allow an Html form even if no parameters specified request.Body = requestManager.BuildBody(actionContentType, uri, procedurePayload); } } }