| 
					
				 | 
			
			
				@@ -10,8 +10,8 @@ import Foundation 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import CoreLocation 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 struct Person: Codable { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    var name: String 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    var age: Int 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    var latitude: Double 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    var longitude: Double 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //class SendPOSTData { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -20,20 +20,20 @@ struct Person: Codable { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         print("placeOrder") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         locations.forEach { (location) in 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				              
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            let person = Person(name: "Josh", age: 30) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            let person = Person(latitude: location.coordinate.latitude, longitude: location.coordinate.longitude) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let jsonEncoder = JSONEncoder() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             jsonEncoder.outputFormatting = .prettyPrinted 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+           
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             var uploadData:Data? 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             do { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 uploadData = try jsonEncoder.encode(person) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                let endcodeStringPerson = String(data: uploadData! , encoding: .utf8)! 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                print(endcodeStringPerson) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                //let endcodeStringPerson = String(data: uploadData! , encoding: .utf8)! 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                //print(endcodeStringPerson) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } catch { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 print(error.localizedDescription) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				              
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            let url = URL(string: "http://chef.maya.se/gpsapi/cupcakes")! 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            let url = URL(string: "http://chef.maya.se/gpsapi/registerGPSlocation.php")! 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             var request = URLRequest(url: url) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             request.setValue("application/json", forHTTPHeaderField: "Content-Type") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             request.httpMethod = "POST" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -49,7 +49,7 @@ struct Person: Codable { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if let mimeType = response.mimeType, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    mimeType == "application/json", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    mimeType == "text/html", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     let data = data, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     let dataString = String(data: data, encoding: .utf8) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     print ("got data: \(dataString)") 
			 |