Exemplo n.º 1
0
        protected override string BuildRequestUrl(Resource resource)
        {
            if (!resource.HasParameters)
            {
                return resource.Path;
            }

            var queryString = resource.GetEncodedParameters();

            return string.Concat(resource.Path, "?", queryString);
        }
Exemplo n.º 2
0
        public string BuildRequestUrl(IArrayFormatter arrayFormatter)
        {
            if (!Resource.HasParameters || Body.ConsumesResourceParameters)
            {
                return(Resource.Path);
            }

            var queryString = Resource.GetEncodedParameters(arrayFormatter);

            return(string.Concat(Resource.Path, "?", queryString));
        }
Exemplo n.º 3
0
        public ISerializableBody Serialize(ITransmissionSettings transmissionSettings, IArrayFormatter arrayFormatter)
        {
            if (resource.HasParameters)
            {
                var parameters = resource.GetEncodedParameters(arrayFormatter);
                var content    = Encoding.UTF8.GetBytes(parameters);

                return(new SerializableByteArray("application/x-www-form-urlencoded", content));
            }

            return(new SerializableByteArray(transmissionSettings.DefaultSerializerContentType, new byte[0]));
        }