code: public static void ensureContentTypeIsJson( CResponse response, boolean isRetriable )
              throws CStorageException
      {
          String contentType = response.getContentType();
  
          CStorageException ex = null;
          if ( contentType == null ) {
              ex = buildCStorageException( response, "Undefined Content-Type in server response", null );
  
          } else if ( !contentType.contains( "application/json" ) && !contentType.contains( "text/javascript" ) ) {
              ex = buildCStorageException( response, "Content-Type is not json: " + contentType, null );
          }
  
          if ( ex != null ) {
              if ( isRetriable ) {
                  ex = new CRetriableException( ex );
              }
              throw ex;
          }
      }
docs: Extract content type from response headers, and ensure it is application/json or text/javascript. If no
  content-type is defined, or content-type is not json, raises a CHttpError.
  
  @param response the response to check
  @param isRetriable if True, raised exception is wrapped into a CRetriable