curl - Airplay http requests -
i'm trying build android controler airplay receiver (contained in tv mediaplayer).
i'm using curl testing request , postman, chrome extension builds http requests. requests understood server if use postman, must not reproduce request curl.
for example, request asks current position media played:
curl -i \ 192.168.1.42:7000/scrub \ -h "connection: keep-alive" \ -h "cache-control: no-cache" \ -h "user-agent: mozilla/5.0 (x11; linux x86_64) applewebkit/537.31 (khtml, gecko) chrome/26.0.1410.63 safari/537.31" \ -h "accept: */*" \ -h "accept-language: fr-fr,fr;q=0.8,en-us;q=0.6,en;q=0.4" \ -h "accept-encoding: gzip,deflate,sdch" \ -h "accept-charset: iso-8859-1,utf-8;q=0.7,*;q=0.3" \
returns:
http/1.1 200 ok content-type: text/parameters content-length: 38 duration: 0.000000 position: 0.000000
while postman returns correct values:
duration: 275.838989 position: 13.000000
the headers used in curl request come request made postman using dev-tools of chrome.
so, there difference in request in chrome between request sent , see in dev-tools? problem come elsewhere, make no sense me curl cannot reproduce same response.
two things try:
check result of curl -v see headers passing command line. ensure matches headers being sent via postman
check if host setting cookies (tab in postman). if is, try enabling cookies on curl request -b option http://curl.haxx.se/docs/http-cookies.html
Comments
Post a Comment