Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Post Handler Does not work #597

Description

@Semmarl

Get requests to server works and responsive but POST requests gives connection time out for iOS app.

[DEBUG] Did open connection on socket 11 [DEBUG] Did connect [DEBUG] Connection received 517 bytes on socket 11 [DEBUG] Did start background task [ERROR] No more data available on socket 11 [DEBUG] Connection aborted with status code 500 on socket 11 [DEBUG] Connection sent 116 bytes on socket 11 [DEBUG] Did close connection on socket 11 [VERBOSE] [192.168.1.110:8080] 192.168.1.106:53390 500 "(invalid request)" (517 | 116) [DEBUG] Did disconnect [DEBUG] Did end background task

Code:

`webServer.addDefaultHandler(forMethod: "GET", request: GCDWebServerRequest.self, processBlock: {request in

        return GCDWebServerDataResponse(html:"<html><body><p>Hello World</p></body></html>")
            
        })
    
    webServer.addDefaultHandler(forMethod: "POST", request: GCDWebServerURLEncodedFormRequest.self, processBlock: {request in
        return GCDWebServerDataResponse(html:"<html><body><p>Hello World</p></body></html>")     
        })
        
    webServer.start(withPort: 8080, bonjourName: "GCD Web Server")
    
    print("Visit \(webServer.serverURL) in your web browser")
    `

How can I fix this please?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions