Moya: How to write Method if a request has both GET and POST method?

Created on 29 Nov 2016  路  2Comments  路  Source: Moya/Moya

example , if .zen has both GET and POST how to write?

public var path: String {
        switch self {
        case .zen:
            return "/zen"
        }
    }
public var method: Moya.Method {
        switch self {
        case .zen   
          return       //return what ?
        }
    }
question

Most helpful comment

The solution is to use two different enum cases that return the same path. Maybe fetchZen and createZen. Does that make sense?

All 2 comments

The solution is to use two different enum cases that return the same path. Maybe fetchZen and createZen. Does that make sense?

OK锛宨t seems a good idea ~

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GurpalRajput picture GurpalRajput  路  3Comments

fenixsolorzano picture fenixsolorzano  路  3Comments

hjzCy picture hjzCy  路  3Comments

holysin picture holysin  路  3Comments

PlutusCat picture PlutusCat  路  3Comments