Answer the question
In order to leave comments, you need to log in
How to convert string to f-string?
People, tell me how to insert the timestamp variable into the id field instead of the static unixtime 1537792692 in the data variable?
The code:
import requests
import time
timestamp = int(time.time())
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer ',
}
data = '{ "id":"1537792692", "sum": { "amount":10, "currency":"643" }, "paymentMethod": { "type":"Account", "accountId":"643" }, "fields": { "account":"45654" } }'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question