send_request_cgi is HttpClient’s CGI-compatible HTTP request API. Its implementation is in lib/msf/core/exploit/remote/http_client.rb; opts are defined in lib/rex/proto/http/client.rb / client_request.rb.
ctype sets the format of the outgoing body through the Content-Type header. For JSON, use 'ctype' => 'application/json'. If omitted for POST, application/x-www-form-urlencoded is added.
Accept specifies the desired response format. To request JSON, use 'headers' => { 'Accept' => 'application/json' }. Setting ctype does not add Accept automatically, so specify both for APIs that require content negotiation.