my problem is the following.
I am acting as a http(s) client in c/c++. Now i get redirected very often with status code 302, from http to https and vice versa. Inside the code i have to delete the http client and create a https client every time i get redirected from http to https and vice versa.
Is there a better way, without calling constructor/destructor again and again ?
I was thinking about one client for http and https. The problem i am facing here is that usually the ports differ, so thats not possible, right ?
Just to add one more thing. Sometimes the new location is even from another host. So basically i end up recreating the client for only e.g. one GET request. The servers i am dealing with are not google or other nice ones, but still i cannot believe that recreating is the only way.
Thank you in advance,
Best Regards