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

  • SEARCH
  • Home
  • 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 7954655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:29:39+00:00 2026-06-04T03:29:39+00:00

I send post parameter like css=request.POST[‘q’] css=css.encode(‘utf-8’) and css has content like { container:

  • 0

I send post parameter like

css=request.POST['q']
css=css.encode('utf-8')

and css has content like

{
    "container": {
        "border-color": "white",
        "border-width": "0px",
        "height": "419px",
        "width": "200px",
        "border-style": "solid",
        "position": "relative",
        "background-color": "white"
    },
    "elemorder": {
        "productcode": {
            "font-size": "14px",
            "line-height": "18px",
            "color": "blue",
            "border-width": "0px",
            "letter-spacing": "0px",
            "text-decoration": "none",
            "height": "40px",
            "width": "200px",
            "border-color": "white",
            "font-weight": "normal",
            "font-style": "normal",
            "position": "absolute",
            "overflow": "hidden",
            "font-family": "Arial",
            "border-style": "solid",
            "display": "block",
            "background-color": "#3385D6",
            "text-align": "center"
        },
        "name": {
            "font-size": "14px",
            "line-height": "18px",
            "color": "blue",
            "border-width": "0px",
            "letter-spacing": "0px",
            "text-decoration": "none",
            "height": "40px",
            "width": "200px",
            "border-color": "white",
            "font-weight": "normal",
            "font-style": "normal",
            "position": "absolute",
            "overflow": "hidden",
            "font-family": "Arial",
            "border-style": "solid",
            "display": "block",
            "background-color": "#3385D6",
            "text-align": "center"
        },
        "url": {
            "font-size": "14px",
            "line-height": "18px",
            "color": "blue",
            "border-width": "0px",
            "letter-spacing": "0px",
            "text-decoration": "none",
            "height": "40px",
            "width": "200px",
            "border-color": "white",
            "font-weight": "normal",
            "font-style": "normal",
            "position": "absolute",
            "overflow": "hidden",
            "font-family": "Arial",
            "border-style": "solid",
            "display": "block",
            "background-color": "#3385D6",
            "text-align": "center"
        },
        "price": {
            "font-size": "14px",
            "line-height": "18px",
            "color": "blue",
            "border-width": "0px",
            "letter-spacing": "0px",
            "text-decoration": "none",
            "height": "40px",
            "width": "200px",
            "border-color": "white",
            "font-weight": "normal",
            "font-style": "normal",
            "position": "absolute",
            "overflow": "hidden",
            "font-family": "Arial",
            "border-style": "solid",
            "display": "block",
            "background-color": "#3385D6",
            "text-align": "center"
        },
        "id": {
            "font-size": "14px",
            "line-height": "18px",
            "color": "blue",
            "border-width": "0px",
            "letter-spacing": "0px",
            "text-decoration": "none",
            "height": "40px",
            "width": "200px",
            "border-color": "white",
            "font-weight": "normal",
            "font-style": "normal",
            "position": "absolute",
            "overflow": "hidden",
            "font-family": "Arial",
            "border-style": "solid",
            "display": "block",
            "background-color": "#3385D6",
            "text-align": "center"
        },
        "imgurl": {
            "font-size": "14px",
            "line-height": "18px",
            "color": "blue",
            "border-width": "0px",
            "letter-spacing": "0px",
            "text-decoration": "none",
            "height": "227",
            "width": 200,
            "border-color": "white",
            "font-weight": "normal",
            "font-style": "normal",
            "position": "absolute",
            "overflow": "hidden",
            "font-family": "Arial",
            "border-style": "solid",
            "display": "block",
            "background-color": "#3385D6",
            "text-align": "center",
            "left": 0,
            "top": 80
        },
        "desc": {
            "font-size": "13px",
            "line-height": "18px",
            "color": "blue",
            "border-width": "0px",
            "letter-spacing": "0px",
            "text-decoration": "none",
            "height": "69",
            "width": "200px",
            "border-color": "white",
            "font-weight": "normal",
            "font-style": "normal",
            "position": "absolute",
            "overflow": "auto",
            "font-family": "Arial",
            "border-style": "solid",
            "display": "block",
            "background-color": "#3385D6",
            "text-align": "center",
            "left": 0,
            "top": 307
        }
    }
}

and I put that in css variable. I am trying to put dictionary like

elemorder=css['elemorder']
container=css['container']

but I get error string indices must be integers, not str How to create two variable (dictionary) elemorder and container ?

  • 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-04T03:29:41+00:00Added an answer on June 4, 2026 at 3:29 am

    From POST request you get str not dict. Try to use json lib like

    import json
    css = json.loads(request.POST['q'])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Rails 3 question. If i send a request like this PUT http://myapp/posts/123?post [title]=hello then
I have a program to send POST request to a server. I'm using cURL
I need to send a post request when the user leaves the page in
I'm trying to send a post request to Parse: https://parse.com/docs/rest#objects-creating . Can't get it
Trying to find a way to send a POST HTTPS request from Python to
How do you send a large (>5MB) post parameter (among other post parameters) in
Is it possible (and how) to send a post request with an array stored
I want to make a POST request to a URL like this: http://localhost/resource?auth_token=1234 And
I need from one JSP open another JSP, and send POST parameters to this
I'm tying to send POST data from one site to another (both sites have

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.