I have defined a char array with a predefined HTTP post string like this:
char header[] = "POST /api/add HTTP/1.1\r\nHost: xxxxxxx:3000\r\nContent-Type: application/octet-stream; charset=utf-8\r\nContent-Length: 500\r\nName: ";
strcat(header, strDevicename); \\
strcat(header, "\r\n\r\n");
where the strDevicename is a char variable name changed every request.
The problem is when I run it for the first time, it is working but after that getting overwritten Name with a96ed5ÿÿa96ed58e8355.
What is the best way to add two string with one real-time change variable using C languages in HTTP post header?