Fixing 422 response python requests get

257 views Asked by At
h= {
    "Host": "gobiernoenlinea1.jalisco.gob.mx",
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0",
    "Accept": "application/json, text/javascript, */*; q=0.01",
    "Accept-Language": "es-MX,es;q=0.8,en-US;q=0.5,en;q=0.3",
    "Accept-Encoding": "gzip, deflate, br",
    "X-CSRF-TOKEN": "undefined",
    "DNT": "1",
    "Connection": "keep-alive",
    "Referer": "https://gobiernoenlinea1.jalisco.gob.mx/vehicular/",
    "Cookie": "A10GOEL-red_hat_vehicular=KBAIBAKM; A10GOEL-red_hat_contestat=JHAIBAKM",
}

uu= "https://gobiernoenlinea1.jalisco.gob.mx/vehicular/series?captchaResponse=03AGdBq24iUDgEJNy7itqIDKBcQ0AkSVbqvLDs6Kn_259mEgcjMdvtpvMvjBbefao-ER7QdDasz-goxokFZGVIYsIZ604faCPoHGY3U4sPoFPEbBU3G6QnLLdIXrY4A9BTByVc6Ob4p3yKgkOYrOeU0Qlf7-2l--tEwpsGucrc2ep0jjiPmV-BkpJ90-QTJFgcowKAZCzfLdf_H5RXPh6e8abuxY8v4BJ_x_NW8-5aLjwYDQouFYHUjhrfsX0HKzknJ8EmJBEBFhK_7DQvFxHs8A7GOgoyL2aB4rqHj2t9rfBLf_oVuHR-dbwEP_LJmIbucAH4i8jlGByNW1xLebd-Jp3VPI04Six5VdMln2gHw-ErnlQpG6nRFoRyJsrxmYsqDfAw-_5MHHAXFyGgCMCggfRJBXwz_mIfPZMsTssu3qxT9n6R5Scfaz0w8Nqi-bMubB98ZMNGhmYs&numeroDeSerie=JTFSX23P4G6166934&placa=JMS6492"

rk= requests.get(uu,headers=h,verify=False)

<Response [422]>

How can I get a reponse 200?

1

There are 1 answers

0
eten On

A 422 response means that it is an Unprocessable Entity, and something is wrong with your request. Try removing the captchaResponse=03AGdBq24iUDgEJNy7itqIDKBcQ0AkSVbqvLDs6Kn_259mEgcjMdvtpvMvjBbefao-ER7QdDasz-goxokFZGVIYsIZ604faCPoHGY3U4sPoFPEbBU3G6QnLLdIXrY4A9BTByVc6Ob4p3yKgkOYrOeU0Qlf7-2l--tEwpsGucrc2ep0jjiPmV-BkpJ90-QTJFgcowKAZCzfLdf_H5RXPh6e8abuxY8v4BJ_x_NW8-5aLjwYDQouFYHUjhrfsX0HKzknJ8EmJBEBFhK_7DQvFxHs8A7GOgoyL2aB4rqHj2t9rfBLf_oVuHR-dbwEP_LJmIbucAH4i8jlGByNW1xLebd-Jp3VPI04Six5VdMln2gHw-ErnlQpG6nRFoRyJsrxmYsqDfAw-_5MHHAXFyGgCMCggfRJBXwz_mIfPZMsTssu3qxT9n6R5Scfaz0w8Nqi-bMubB98ZMNGhmYs&numeroDeSerie=JTFSX23P4G6166934& from the url to make it https://gobiernoenlinea1.jalisco.gob.mx/vehicular/series?placa=JMS6492.