Page 1 of 1

Formatting Post json

Posted: Tue Nov 21, 2023 6:06 pm
by AndyP
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

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}"
})
But I'm having problems formatting this correctly for the tsnetPost tPostData var as below

Code: Select all

put tsNetPost("connectionA",tUrl,tHeaders,tPostData,"postResponse") into tError
Normally I can get my head around this type of thing, but this one is stumping me.

Re: Formatting Post json

Posted: Tue Dec 26, 2023 1:14 am
by JereMiami
Any luck with this?