How I can post json to my serve?


#1

In CLI “generate” command there are no “service” option.
There are another option to post json to my serve?


#2

In Ionic you generate providers, not services. Check the documentation out.


#3

Thanks, I Just created a provider and import it.

I have:

@Injectable()
export class ConectmeProvider {
	hi(){
		console.log('hi people');
	}
  constructor(public http: Http) {

    console.log('Hello Man ConectmeProvider Provider');
  }

}

How can I send a json with this?


#4

It depends, to which server do you want to send it? Some database like Firebase?


#5

Check out the Tour of Heroes http client bit.


#6

In the file echo.php is the server side.