Demo entry 6717893

asdfsa

   

Submitted by anonymous on Mar 01, 2018 at 05:20
Language: Swift. Code size: 1.2 kB.

        // create request builder
        if let actionReqBuilder = RestliActionRequestBuilder<NSString>(with: NSString.self) {
            // set request url
            actionReqBuilder.setRelativePath(RestliRoutePathVoyagerRelationshipsInvitations)

            // add query parameters
            actionReqBuilder.queryParameters = [RestliRouteParameterAction: RestliRouteParameterAcceptByInvitee]

            // add action parameters
            actionReqBuilder.actionParams = [RestliRouteParameterInviterProfileId: "profileID"]

            // add completion Handler
            actionReqBuilder.completion = { dataResponse in
                let _: RestliActionResponse<NSString>? = dataResponse?.model
                // use responseModel
            }

            // optional: perf tracking
            actionReqBuilder.addPerformanceTracking(forPageKey: "pageKey")

            // send request
            if let actionRequest = try? actionReqBuilder.build() {
                LINDependencies.infra.dataManager.execute(actionRequest as! LIDataRequest<LIDataModel, LIDataModel>)
            } else {
                // catch error
            }
        }

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).