Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can someone teach me how to post request to services on localhost #2317

Open
Misaka-Tang opened this issue Aug 24, 2023 · 3 comments
Open

Can someone teach me how to post request to services on localhost #2317

Misaka-Tang opened this issue Aug 24, 2023 · 3 comments

Comments

@Misaka-Tang
Copy link

I first time used moya framework and once I made a function want to get data from localhost:

func getUsrDatasReg(account: String, pass: String) -> Void {
    getData.request(ServiceType.usr(detailType: .register(account: account, pass: pass))){
      ret in
      switch ret{
      case .success(let ok):
        print(ok.data, ok.statusCode)
      case .failure(let err):
        print(MoyaError.statusCode, err)
      }
    }
  }

it didn't come into 'ret in' closure when I check breakpoint, and it says handler for XPC error: Connection invalid, why cause such problem, how to fix?

@Gerzer
Copy link

Gerzer commented Aug 25, 2023

Are you running this code on macOS, iOS, or some other platform?

@Misaka-Tang
Copy link
Author

I developed these codes on IOS.

@Gerzer
Copy link

Gerzer commented Aug 30, 2023

I developed these codes on IOS.

In that case, it’s probably a bug in iOS itself. Third-party code can’t use XPC on iOS, so unless you’ve done some complex reverse-engineering, that particular error is almost certainly not the fault of your own code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants