<commit_before>from rest_framework.decorators import list_route
from rest_framework.response import Response
from rest_framework.viewsets import ViewSet

from c3nav.routing.forms import RouteForm
from c3nav.routing.router import Router


class RoutingViewSet(ViewSet):
    @list_route(methods=['get'])
    def route(self, request, *args, **kwargs):
        params = request.POST if request.method == 'POST' else request.GET
        form = RouteForm(params, request=request)

        if not form.is_valid():<commit_msg>allow post in routing api<commit_after>from rest_framework.decorators import list_route
from rest_framework.response import Response
from rest_framework.viewsets import ViewSet

from c3nav.routing.forms import RouteForm
from c3nav.routing.router import Router


class RoutingViewSet(ViewSet):
    @list_route(methods=['get', 'post'])
    def route(self, request, *args, **kwargs):
        params = request.POST if request.method == 'POST' else request.GET
        form = RouteForm(params, request=request)

        if not form.is_valid():
{'fraction_non_alphanumeric': 0.09185606060606061, 'fraction_numerical': 0.003787878787878788, 'mean_word_length': 4.682795698924731, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2099207', 'n_tokens_mistral': 301, 'n_tokens_neox': 299, 'n_words': 86}