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

syq7970 picture syq7970  路  3Comments

dimpiax picture dimpiax  路  3Comments

sunshinejr picture sunshinejr  路  3Comments

PlutusCat picture PlutusCat  路  3Comments

ghost picture ghost  路  3Comments