Skip to content
Snippets Groups Projects
Select Git revision
  • f783346265f2a1ac9f1ecffe93f5e593d5d76831
  • master default protected
  • 1.31
  • 4.27.0
  • 4.26.0
  • 4.25.5
  • 4.25.4
  • 4.25.3
  • 4.25.2
  • 4.25.1
  • 4.25.0
  • 4.24.3
  • 4.24.2
  • 4.24.1
  • 4.24.0
  • 4.23.6
  • 4.23.5
  • 4.23.4
  • 4.23.3
  • 4.23.2
  • 4.23.1
  • 4.23.0
  • 4.22.3
23 results

Monster_DOM.Assembler.html

Blame
  • issue-217.js 1.73 KiB
    const json = 
        `{
                  "0":  {
                        "id": 1000,
                        "field1": "dataset 1, value field 1",
                        "field2": "dataset 1, value field 2",
                        "field3": "dataset 1, value field 3"
                    },
                   "1": {
                        "id": 1001,
                        "field1": "dataset 2, value field 1",
                        "field2": "dataset 2, value field 2",
                        "field3": "dataset 2, value field 3"
                    }
                   
                }`;
    
    
    // check if json is valid
    JSON.parse(json)
    
    const json400Error=`[
                    {
                        "sys": {
                            "type": "Error",
                            "message": "Invalid request"
                        }
                    }
                ]`
    
    // check if json is valid
    JSON.parse(json400Error)
    
    
    const json200Error=`[
                    {
                        "sys": {
                            "type": "Error",
                            "message": "Invalid request"
                        }
                    }
                ]`
    
    // check if json is valid
    JSON.parse(json200Error)
    
    export default [
        {
            url: '/issue-217.json',
            method: 'get',
            rawResponse: async (req, res) => {
                res.setHeader('Content-Type', 'application/json')
                res.statusCode = 200
    
                setTimeout(function() {
                    res.end(json)
                }, 10);
            },
        },
    
        {
            url: '/issue-217',
            method: 'post',
            rawResponse: async (req, res) => {
                res.setHeader('Content-Type', 'application/json')
                res.statusCode = 400
    
                setTimeout(function() {
                    res.end(json400Error)
                }, 10);
            },
        }
    
      
    
    ];