Skip to content

JSON mounting #2

@WillianKoessler

Description

@WillianKoessler

You could use just a regular dict object and get the string version from it for format the json more easily

data = {
	"pattern": url_where_certificate_will_be_send,`
	"filter": {
		"ISSUER": {
			"CN": issuer.CN,
			"C": issuer.C,
			"O": issuer.O
			},
		"SUBJECT": {
			"CN": subject.CN,
			"C": subject.C,
			"O": subject.O
			}
		}
	}

And in case quotes become a problem: data = data.replace('\'', '"')

You can even use the built-in json library

from json import dumps
data = json.dumps(data, ensure_ascii=False) # if you want to visualize the data, just set a value for the **indent** variable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions