I would like to create a PHP script that would perform a request to an https site using the GET method. In return, I get a response in xml format. I need to be able to get the contents/save this xml.
I've tried using curl, file_get_contents, fopen but I'm getting a Bad Request (400) response. But when I try to go directly to the url, I receive the xml response. Here's the url that I'm trying to get response with:
https://tst.webservices.outsurance.co.za/SecureHost/Lead/LeadPostService.svc/SubmitAffiliateLead?xml=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22+%3F%3E%0D%0A%0D%0A%3Clead%3E%0D%0A+++%3Cmode%3ELIVE%3C%2Fmode%3E%0D%0A%09%3Ctitle%3EMrs%3C%2Ftitle%3E%0D%0A%09%3Cfirstname%3EHannah%3C%2Ffirstname%3E%0D%0A%09%3Clastname%3EDwindle%3C%2Flastname%3E%0D%0A%09%3Cid%3E1723658492165%3C%2Fid%3E%0D%0A%09%3Chomecode%3E%3C%2Fhomecode%3E%0D%0A%09%3Chometel%3E%3C%2Fhometel%3E%0D%0A%09%3Cworkcode%3E011%3C%2Fworkcode%3E%0D%0A%09%3Cworktel%3E132189%3C%2Fworktel%3E%0D%0A%09%3Cmobile%3E0824176239%3C%2Fmobile%3E%0D%0A%09%3Cemail%3Ehannahdwindle@gmail.com%3C%2Femail%3E%0D%0A%09%3Ccomment%3ETHIS+IS+A+COMMENT%3C%2Fcomment%3E%0D%0A%09%3Csource%3EUPSTART%3C%2Fsource%3E%0D%0A%09%3Cnotes%3ETHIS+I+A+NOTE%3C%2Fnotes%3E%0D%0A%09%3Clanguage%3EE%3C%2Flanguage%3E%0D%0A%09%3Cproduct%3EP%3C%2Fproduct%3E%0D%0A%3C%2Flead%3E%0D%0A+++++++++
I really don't kknow what to do now. I have tried every solution that I've seen on the internet but to no avail.