Formatting Post json
Posted: Tue Nov 21, 2023 6:06 pm
I'm playing around with the GitHub api and I am problems formatting the correct json string to send via tsnetPost.
I have this section of code from a working python script
But I'm having problems formatting this correctly for the tsnetPost tPostData var as below
Normally I can get my head around this type of thing, but this one is stumping me.
I have this section of code from a working python script
Code: Select all
# Create a dictionary to store the data for your new repository
data = {
"name": "my-new-repository",
"description": "This is my new repository",
"private": False
}
# Send a POST request to the API endpoint to create a new repository
response = requests.post(f"{api_base_url}/user/repos", json=data, headers={
"Authorization": f"Bearer {personal_access_token}"
})
Code: Select all
put tsNetPost("connectionA",tUrl,tHeaders,tPostData,"postResponse") into tError