Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error posting with requests
#1
So I've created a code that posts something on a website. It works perfectly fine when I run it like this (+ other code but that isnt important):
# Above is other (correct) code, wich isnt important
        payload = {
            "firstName": self.first_name,
            "lastName": self.last_name,
            "email": "[email protected]",
            "dateOfBirth": self.dob,
            "termsAccepted": 'true',
            "variantId": int(self.size),
            "articleId": int(self.url),
        }
        response = requests.post(url2, payload, proxies=proxies)
        print(response.status_code)
It prints out '200', so this code works.
But when I run it with the (SAME) email being a variable.
So like this:
# Above is other (correct) code, wich isnt important
        payload = {
            "firstName": self.first_name,
            "lastName": self.last_name,
            "email": self.email,
            "dateOfBirth": self.dob,
            "termsAccepted": 'true',
            "variantId": int(self.size),
            "articleId": int(self.url),
        }
        response = requests.post(url2, payload, proxies=proxies)
        print(response.status_code)
it prints out (500), with the reason: internal server error.

Does someone know why?
Reply


Messages In This Thread
Error posting with requests - by julio2000 - Mar-28-2020, 09:25 PM
RE: Error posting with requests - by buran - Mar-28-2020, 09:29 PM
RE: Error posting with requests - by julio2000 - Mar-28-2020, 09:32 PM
RE: Error posting with requests - by buran - Mar-28-2020, 09:34 PM
RE: Error posting with requests - by julio2000 - Mar-28-2020, 09:37 PM
RE: Error posting with requests - by buran - Mar-28-2020, 09:41 PM
RE: Error posting with requests - by julio2000 - Mar-28-2020, 09:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  POST requests - different requests return the same response Default_001 3 1,974 Mar-10-2022, 11:26 PM
Last Post: Default_001
  Instagram Bot _ Posting Comments kristianpython 3 3,385 May-23-2020, 12:54 PM
Last Post: kristianpython
  Posting value from excel to Form (Python+Selenium) revanth 0 1,828 Feb-05-2020, 10:44 AM
Last Post: revanth
  Posting html values to views/models in Django Malt 1 2,193 Sep-04-2019, 01:44 PM
Last Post: fishhook
  error with requests rudolphyaber 9 5,135 May-20-2019, 06:19 PM
Last Post: rudolphyaber
  Error in requests.post debanilroy 3 5,471 Sep-18-2018, 06:15 PM
Last Post: snippsat
  An Error in Requests Module pratheep 3 11,959 Feb-06-2018, 05:17 PM
Last Post: pratheep

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020