For my github-gist project, I am using JavaScript and AJAX to customize the file name. Here is the JSON data I am working with:
var data = {
"description": gist_description,
"public": true,
"files": {
"file.txt" : {
"content": gist_content
}
}
};
Initially, I set var gist_filename = "main.txt";
Then, I tried replacing "file.txt" with my variable name, so it looked like gist_filename: { "content" : ......}; However, the gist was created with the name gist_filename
instead of using the actual name stored in the variable, which is main.txt
Interestingly, when assigning content like "content": gist_content, it correctly pulls the content from the variable gist_content.
Any advice on how to fix this issue? I'm not very familiar with JSON. Thanks!