1
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    @IBAction func btnGirisYap(_ sender: Any) {
        let config = URLSessionConfiguration.default
        let session = URLSession(configuration: config)
        let url = URL(string: "http://192.168.1.2:8080/WebApplication2/login?user=emrekacan")

        let task = session.dataTask(with: url!,completionHandler: {
        (data,response,error) in
            if error != nil{
               print(error!.localizedDescription)
            } else {
                do{
                    if let json = try JSONSerialization.jsonObject(with: data!, options:  .allowFragments) as? [String:Any]
                    {
                        print(json)
                    }

                }
                catch {
                    print("error in jsonserialization")
                }
            }

        })

        task.resume()

        }

}

Json Web Service

ERROR : 2016-11-23 12:38:05.976439 App[1088:21924] [] ____nwlog_simulate_crash_inner_block_invoke dlopen CrashReporterSupport failed 2016-11-23 12:38:05.976944 App[1088:21924] [] __nwlog_err_simulate_crash simulate crash failed "nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available" 2016-11-23 12:38:05.978288 App[1088:21924] [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace: [x86_64] libnetcore-856.20.4 0 libsystem_network.dylib 0x000000010ff66682 __nw_create_backtrace_string + 123 1 libnetwork.dylib 0x0000000110243932 nw_socket_add_input_handler + 3100 2 libnetwork.dylib 0x00000001102214f4 nw_endpoint_flow_attach_protocols + 3768 3 libnetwork.dylib 0x0000000110220511 nw_endpoint_flow_setup_socket + 563 4 libnetwork.dylib 0x000000011021f270 -[NWConcrete_nw_endpoint_flow startWithHandler:] + 2612 5 libnetwork.dylib 0x000000011023a44d nw_endpoint_handler_path_change + 1261 6 libnetwork.dylib 0x0000000110239e7c nw_endpoint_handler_start + 570 7 libdispatch.dylib 0x000000010fce3980 _dispatch_call_block_and_release + 12 8 libdispatch.dylib 0x000000010fd0d0cd _dispatch_client_callout + 8 9 libdispatch.dylib 0x000000010fceae6b _dispatch_queue_serial_drain + 236 10 libdispatch.dylib 0x000000010fcebb9f _dispatch_queue_invoke + 1073 11 libdispatch.dylib 0x000000010fcee3b7 _dispatch_root_queue_drain + 720 12 libdispatch.dylib 0x000000010fcee08b _dispatch_worker_thread3 + 123 13 libsystem_pthread.dylib 0x00000001100b64de _pthread_wqthread + 1129 14 libsystem_pthread.dylib 0x00000001100b4341 start_wqthread + 13

emre
  • 21
  • 4
  • See this answer: http://stackoverflow.com/questions/39545603/error-protocol-not-available-dumping-backtrace for a possible solution. – koen Nov 23 '16 at 13:08
  • Visit this related [thread](https://stackoverflow.com/questions/39545603/error-protocol-not-available-dumping-backtrace). Thanks – Filipe Dias Jan 15 '17 at 14:24

0 Answers0