<commit_before>﻿using System.Linq;
using System.Reflection;

namespace RequestHandlers.Http
{
    public class HttpRequestHandlerDefinition
    {
        public HttpRequestHandlerDefinition(HttpRequestAttribute attribute, IRequestDefinition definition)
        {
            var parsedRoute = attribute.Parse();

            var isFormRequest = definition.RequestType.GetTypeInfo().GetCustomAttribute<Http.FromFormAttribute>() != null;

            var canHaveBody = attribute.HttpMethod == HttpMethod.Patch
                              || attribute.HttpMethod == HttpMethod.Post
                              || attribute.HttpMethod == HttpMethod.Put;

            var bindingFlags = BindingFlags.Public | BindingFlags.Instance | BindingFlags.SetProperty | BindingFlags.GetProperty;

            var defaultBinder = // when unable to detect binding, this will be the default
                canHaveBody
                    ? isFormRequest
                        ? BindingType.FromForm
                        : BindingType.FromBody
                    : BindingType.FromQuery;<commit_msg>Update HttpRequestHandlerDefinition<commit_after>﻿using System.Linq;
using System.Reflection;

namespace RequestHandlers.Http
{
    public class HttpRequestHandlerDefinition
    {
        public HttpRequestHandlerDefinition(HttpRequestAttribute attribute, IRequestDefinition definition)
        {
            var parsedRoute = attribute.Parse();

            var isFormRequest = definition.RequestType.GetTypeInfo().GetCustomAttribute<Http.FromFormAttribute>() != null;

            var canHaveBody = attribute.HttpMethod == HttpMethod.Patch
                              || attribute.HttpMethod == HttpMethod.Post
                              || attribute.HttpMethod == HttpMethod.Delete
                              || attribute.HttpMethod == HttpMethod.Put;

            var bindingFlags = BindingFlags.Public | BindingFlags.Instance | BindingFlags.SetProperty | BindingFlags.GetProperty;

            var defaultBinder = // when unable to detect binding, this will be the default
                canHaveBody
                    ? isFormRequest
                        ? BindingType.FromForm
                        : BindingType.FromBody
                    : BindingType.FromQuery;
{'fraction_non_alphanumeric': 0.06669591926283458, 'fraction_numerical': 0.0, 'mean_word_length': 2.097826086956522, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2400279', 'n_tokens_mistral': 502, 'n_tokens_neox': 472, 'n_words': 106}