• Чем отличается запрос python-requests от запроса Fiddler?

    @pronetey2 Автор вопроса
    MinTnt, например такую:


    Value for header {Content-Length: 2662} must be of type str or bytes, not
  • Чем отличается запрос python-requests от запроса Fiddler?

    @pronetey2 Автор вопроса
    MinTnt, буду очень благодарен если поможете
  • Чем отличается запрос python-requests от запроса Fiddler?

    @pronetey2 Автор вопроса
    MinTnt, ну да, я всё передаю как строку, потому что requests принимает это всё только как строки. Если я передам число или булл, то он выдаст соответствующую ошибку
  • Чем отличается запрос python-requests от запроса Fiddler?

    @pronetey2 Автор вопроса
    MinTnt, если не правильно передаю, тогда почему фиддлер точно такой же запрос передает правильно?
    помогите, пожалуйста, как передать правильно?
    браузер тоже передает в мултипарт, если вы об этом
  • Чем отличается запрос python-requests от запроса Fiddler?

    @pronetey2 Автор вопроса
    MinTnt,

    Вот raw с python запроса:
    POST https://account.mail.ru/api/v1/user/signup HTTP/1.1
    Host: account.mail.ru
    Connection: keep-alive
    Content-Length: 2571
    sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="96", "Google Chrome";v="96"
    sec-ch-ua-mobile: ?1
    User-Agent: Mozilla/5.0 (Linux; Android 7.1.2; SM-U614M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.104 Mobile Safari/537.36
    Accept: application/json, text/plain, */*
    X-Requested-With: XMLHttpRequest
    X-Request-Id: 86c3d6b-d649-f6e2-a9f4-968c35b483d5
    sec-ch-ua-platform: Android
    Origin: https://account.mail.ru
    Sec-Fetch-Site: same-origin
    Sec-Fetch-Mode: cors
    Sec-Fetch-Dest: empty
    Referer: https://account.mail.ru/signup?from=main_m_touch
    Accept-Encoding: gzip, deflate, br
    Accept-Language: ru-RU,ru;q=0.9
    Cookie: 
    Content-Type: multipart/form-data; boundary=06814ba3b00c23c08ed0f90f545e022b
    
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="extended"
    
    true
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="more_password_strength"
    
    1
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="context"
    
    signup
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="browser"
    
    {"screen":{"availWidth":"854","availHeight":"480","width":"854","height":"480","colorDepth":"24","pixelDepth":"24","availLeft":"0","availTop":"0"},"navigator":{"vendorSub":"","productSub":"20030107","vendor":"Google Inc.","maxTouchPoints":"5","doNotTrack":"inaccessible","hardwareConcurrency":"4","cookieEnabled":"true","appCodeName":"Mozilla","appName":"Netscape","appVersion":"5.0 (Linux; Android 7.1.2; SM-U614M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.104 Mobile Safari/537.36","platform":"Linux i686","product":"Gecko","userAgent":"Mozilla/5.0 (Linux; Android 7.1.2; SM-U614M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.104 Mobile Safari/537.36","language":"ru-RU","onLine":"true","webdriver":"false","pdfViewerEnabled":"false","deviceMemory":"4"},"flash":{"version":"inaccessible"}}
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="from"
    
    main_m_touch
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="sent_me_ads"
    
    true
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="sent_me_ads_common"
    
    true
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="name"
    
    {"first": "karina","last": "famina"}
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="birthday"
    
    {"day": 2,"month": 4,"year": 1996}
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="sex"
    
    female
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="login"
    
    sfwergdhj5
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="domain"
    
    mail.ru
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="password"
    
    ===aaa===aaa
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="restore"
    
    {"secret": "-","secret_answer": "-","additional_email": "gdsghy1td@ghfgyjhg.ru"}
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="htmlencoded"
    
    false
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="utm"
    
    {"source": "","medium": "","campaign": "","term": "","content": ""}
    --06814ba3b00c23c08ed0f90f545e022b--


    А это с запроса Фиддлера:

    POST https://account.mail.ru/api/v1/user/signup HTTP/1.1
    Host: account.mail.ru
    Connection: keep-alive
    Content-Length: 2571
    sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="96", "Google Chrome";v="96"
    sec-ch-ua-mobile: ?1
    User-Agent: Mozilla/5.0 (Linux; Android 7.1.2; SM-U614M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.104 Mobile Safari/537.36
    Accept: application/json, text/plain, */*
    X-Requested-With: XMLHttpRequest
    X-Request-Id: 86c3d6b-d649-f6e2-a9f4-968c35b483d5
    sec-ch-ua-platform: Android
    Origin: https://account.mail.ru
    Sec-Fetch-Site: same-origin
    Sec-Fetch-Mode: cors
    Sec-Fetch-Dest: empty
    Referer: https://account.mail.ru/signup?from=main_m_touch
    Accept-Encoding: gzip, deflate, br
    Accept-Language: ru-RU,ru;q=0.9
    Cookie: 
    Content-Type: multipart/form-data; boundary=06814ba3b00c23c08ed0f90f545e022b
    
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="extended"
    
    true
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="more_password_strength"
    
    1
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="context"
    
    signup
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="browser"
    
    {"screen":{"availWidth":"854","availHeight":"480","width":"854","height":"480","colorDepth":"24","pixelDepth":"24","availLeft":"0","availTop":"0"},"navigator":{"vendorSub":"","productSub":"20030107","vendor":"Google Inc.","maxTouchPoints":"5","doNotTrack":"inaccessible","hardwareConcurrency":"4","cookieEnabled":"true","appCodeName":"Mozilla","appName":"Netscape","appVersion":"5.0 (Linux; Android 7.1.2; SM-U614M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.104 Mobile Safari/537.36","platform":"Linux i686","product":"Gecko","userAgent":"Mozilla/5.0 (Linux; Android 7.1.2; SM-U614M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.104 Mobile Safari/537.36","language":"ru-RU","onLine":"true","webdriver":"false","pdfViewerEnabled":"false","deviceMemory":"4"},"flash":{"version":"inaccessible"}}
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="from"
    
    main_m_touch
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="sent_me_ads"
    
    true
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="sent_me_ads_common"
    
    true
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="name"
    
    {"first": "karina","last": "famina"}
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="birthday"
    
    {"day": 2,"month": 4,"year": 1996}
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="sex"
    
    female
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="login"
    
    sfwergdhj5
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="domain"
    
    mail.ru
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="password"
    
    ===aaa===aaa
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="restore"
    
    {"secret": "-","secret_answer": "-","additional_email": "gdsghy1td@ghfgyjhg.ru"}
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="htmlencoded"
    
    false
    --06814ba3b00c23c08ed0f90f545e022b
    Content-Disposition: form-data; name="utm"
    
    {"source": "","medium": "","campaign": "","term": "","content": ""}
    --06814ba3b00c23c08ed0f90f545e022b--
  • Чем отличается запрос python-requests от запроса Fiddler?

    @pronetey2 Автор вопроса
    помоги, пожалуйста, как тогда правильно передать эти заголовки
    и я не понимаю, fiddler их сам меняет что ли? ведь запрос точно такой же