Milano
Milano

Reputation: 18745

Can't get parameters from post in view - Django

I'm facing a weird problem. Suddenly I can't get data from POST request in my view. I can see that it's there.

@csrf_exempt
def get_candidate_prices_and_xpaths(request):

    if request.method == 'POST':
        print request.POST
        request_url =  request.POST.get('request_url','')
        print request_url

I can see in command line this:

<QueryDict: {u'product_url': [u'asdasd']}>

and the empty line (the second print)

How to access the request_url parameter from post?

Upvotes: 1

Views: 223

Answers (1)

ozren1983
ozren1983

Reputation: 1951

You are using two different variables: request_url and product_url.

Upvotes: 3

Related Questions