Showing posts with label send rest from command line. Show all posts
Showing posts with label send rest from command line. Show all posts

Thursday, October 23, 2014

Send json data from command line example

Command line example for sending JSON data:

$ curl -i -X POST -H "Content-Type:application/json" -d '{ "recordId" : "0000108", "itemOrigin" : "South Korea" }' http://localhost:8080/stocks


#!/bin/bash

wget --header='X-Real-IP: 12.12.12.12' --header='User-Agent: Mozilla/5.0 Gecko/2010 Firefox/5' --header='Content-Type: application/json' --header='ganita-token:573652060cf21c7e32f933c8'  - 'https://preprod.lojika.net/api/v2/trips/feed?groupResults=true&searchTripId=492d04c9e4b0e8158db4b4b1&timeFilter=SAVED' &
wget --header='X-Real-IP: 12.12.12.12' --header='User-Agent: Mozilla/5.0 Gecko/2010 Firefox/5' --header='Content-Type: application/json' --header='ganita-token:58ca8374e4b01bd251a550d1'  - 'https://preprod.lojika.net/api/v2/trips/feed?groupResults=true&searchTripId=492d0809e4b0e8158db4bc7a&timeFilter=SAVED' &

or send json request from browser (Postman - A Chrome extension)