11.1 OptServer protocolΒΆ

The server protocol is HTTP plus a couple of extension headers. Commands that the client can use:

POST /api/submit

Post a problem to the server.

On response OK, a token identifying the problem is returned in the response body, and the token cookie is set to the token string. If logins are disabled or anonymous submits are allowed, no authentication is required. Otherwise, one of following is required:

  • An access token, passed in the query part as access-token=..., or
  • a valid session, passed in the session cookie (i.e. a user that is logged in can submit).

GET /api/solve

Start solving and wait for the solver to finish.

The token is passed either as a query string token=<tokenstr>, or in the token cookie. The Accept header identifies the accepted solution formats. Currently recognized formats are:

application/x-mosek-task Request solution in .task format.
application/x-mosek-json Request solution in JSON format.
text/plain Request a plain ASCII formatted solution

GET /api/solve-background

Start solving the identified task in background, return immediately.

It returns OK is the solver started sucessfully. The token is passed either as a query string token=<tokenstr>, or in the token cookie.

GET /api/log

Return the log.

The token is passed either as a query string token=<tokenstr>, or in the token cookie. If the query string contains the parameter offset=XXXX, the log file will be returned from offset XXXX.

GET /api/solution

Return the solution

It returns the solution if available, or NO_CONTENT if the tasks exists but no solution is available. The token is passed either as a query string token=<tokenstr>, or in the token cookie.

HEAD /api/break

Attempt to terminate the solver.

The token is passed either as a query string token=<tokenstr>, or in the token cookie.