> For the complete documentation index, see [llms.txt](https://elixor.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://elixor.js.org/getting-json-data.md).

# Making a GET request

Applications often request JSON data from the server. For example, the app might need a configuration file on the server.\
The `ConfigService` fetches this file with a `get()` method.

{% code title="config.service.ts" %}

```typescript
import { elixor } from 'elixor';

const url = 'https://jsonplaceholder.typicode.com/posts';
export const getConfig = () => {
  return elixor.get(url);
}
```

{% endcode %}

A component, such as `ConfigComponent`,and calls the `getConfig` service method.

{% code title="Config.tsx" %}

```jsx
import * as React from 'react';
import { getConfig } from './services/config.service';

class Config extends React.Component {

  componentDidMount() {
    getConfig()
      .subscribe(r => {
        console.log(r);
      });
  }
}

export default Config;
```

{% endcode %}

Because the service method returns an `Observable` of configuration data, the component **subscribes** to the method's return value.
