swift – Error in Getting response in POST Api – for big param values – Native iOS

0
23
swift – Error in Getting response in POST Api – for big param values – Native iOS


I’ve under operate to cross the params in api name:

func getOrderStatusSummaryParameter(web page: Int) -> JSON {
    let web page = web page
    let pageSize = 25
    let kind = "posted_date"
    let order = "DESC"
    let universalSearch = ""
    let transactionType = ["Sales Order"]
    var model = [Int]()
    var orderPlacedIn = "last_30_days"
    var orderStatus = [String]()
    var postedDateDefault = 0, postedDateFrom = "", postedDateTo = ""
    
    if let controller = wireframe.advanceFilterController {
        model = getBrandItemsIdFrom(information: controller.appliedOrderStatusFilterData?.model)
        orderStatus = getCustomerItemsIdFrom(information: controller.appliedOrderStatusFilterData?.orderStatus)
        orderPlacedIn = controller.appliedOrderStatusFilterData?.orderPlacedIn?.filterId ?? ""
        
        if let postedDates = controller.appliedOrderStatusFilterData?.postedDate, postedDates.rely > 0 {
            postedDateFrom = controller.appliedOrderStatusFilterData?.postedDate?[0].begin ?? ""
            postedDateTo = controller.appliedOrderStatusFilterData?.postedDate?[0].finish ?? ""
            postedDateDefault = controller.appliedOrderStatusFilterData?.postedDate?[0].filterId ?? 0
        }
    }
    
    var paramObject = ["sort": sort] as [String: Any]
    paramObject["page"] = web page
    paramObject["page_size"] = pageSize
    paramObject["sort"] = kind
    paramObject["order"] = order
    paramObject["transaction_type"] = transactionType
    paramObject["universal_search"] = !universalSearch.isEmpty ? universalSearch : nil
    
    if appliedOrderStatusDone {
        paramObject["brand"] = !model.isEmpty ? model : nil
        paramObject["order_placed_filter"] = !orderPlacedIn.isEmpty ? orderPlacedIn : nil
        paramObject["order_status"] = !orderStatus.isEmpty ? orderStatus : nil
        paramObject["posted_date_default"] = postedDateDefault != -1 ? postedDateDefault : nil
        paramObject["posted_date_from"] = !postedDateFrom.isEmpty ? postedDateFrom : nil
        paramObject["posted_date_to"] = !postedDateTo.isEmpty ? postedDateTo : nil
    }

    return paramObject as JSON
}

Right here in above operate you’ll be able to test that there’s a model param and for that model param If I cross few manufacturers deciding on from the checklist UI, Its working high quality.

However If I choose all of the manufacturers – by doing Choose All (complete 12000 values) and passing in params for api name, then not getting any information from the API end result.. even Api name is profitable.

So the problem is for few information its working high quality and for all information i.e. 12000 chosen information it give me no outcomes.

Word that Its working high quality in Net and Postman.. The difficulty is with native IOS.
What I’m lacking right here and Is there something am doing incorrect right here ?

LEAVE A REPLY

Please enter your comment!
Please enter your name here