Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8912025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:05:52+00:00 2026-06-15T04:05:52+00:00

I am using the python package requests to make a get request to a

  • 0

I am using the python package requests to make a get request to a server. My goal is to replicate certain known http requests and incorporated them into my python script. The original query string contains one key-value pair ‘version=0%2E12’ which I know is the url encoded equivalent of ‘version=0.12’. Below is an example of what I am doing to replicate the http request.

params = {
          'version'='0.12',
          'language'='en',
          ...
          }
 resp = requests.get(url, params)

The resulting url query string has ‘version=0.12’ in it. If I try to change the setting of params to the following,

    params = {
          'version'='0%2E12',
          'language'='en',
          ...
          }

but the resulting query string contains ‘version=0%252E31’. Essentially, requests is parsing the % to be url encoded.

How can I get requests to parse my params arguments with periods properly without manually writing the entire url?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T04:05:53+00:00Added an answer on June 15, 2026 at 4:05 am

    Note that . is a perfectly valid character in a URL-encoded value.

    You’d need to encode the values yourself, bypassing the standard encoding. I’d use urllib.urlencode(), then replace the . characters by %2E by hand.

    You then have to append the encoded string as a query parameter to the URL, and configure requests to not re-encode the values:

    params = {
          'version'='0.12',
          'language'='en',
          ...
          }
    params = urllib.urlencode(params)
    params = params.replace('.', '%2E')
    resp = requests.get('?'.join(url, params), config={'encode_uri': False})
    

    The encode_uri parameter set to False does the trick here; it’s this requests default that otherwise will re-encode the whole URL to ensure RFC compliancy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Python Requests. All works great but today I get this strange error:
I am using the csv python package to read a csv file like this:
I am using the subprocess package in Python to run a subprocess, which I
I'm attempting to package a python application ( Mnemosyne ) using py2app (I didn't
Using Python module re, how to get the equivalent of the \w (which matches
I am trying to make an chat application using python and django. I almost
I have a rather large client-server network application, written in Python. I'm using select.poll
Using Mongokit with Python. Having some trouble working out get the last n number
I find that recently often when I try to install a Python package using
I'm using Ubuntu 10, python 2.6.5 I'm following this tutorial: http://www.djangobook.com/en/2.0/chapter02 I followed all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.