Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 982 Bytes

test-webapi.md

File metadata and controls

53 lines (36 loc) · 982 Bytes

test webapi


#!/bin/bash

url="http://localhost:5000"
api="Sample/LoadData"

json=$(cat<<EOF
{
}
EOF
)

res=$(curl -v -s -H "Content-Type:application/json" -d "$json" $url/$api)

echo $res

send post data

curl -d "a=1&b=strval" -X POST http://localhost:5000
curl -d '{"a":1, "b":"strval"}' -H "Content-Type: application/json" -X POST http://localhost:5000

send encoded OData query

curl --get --data-urlencode "\$top=1" http://some/odata/Dataset

send curl request through proxy

using mitmweb can analyze localhost traffic

curl -x "http://localhost:8080" http://some/odata/Dataset

references