JSON

WebServicesÖÐʹÓÃJSON

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£ºH5Ö®¼Ò 2016-01-24 18:13 ÎÒÒªÆÀÂÛ( )

ÊÊÓÃÓÚPS3.0¼°ÒÔºó°æ±¾¡£ ÕâÀï¿ÉÒÔÓÃJSON¸ñʽ´ÓÍøÉϵõ½´óÁ¿µÄÐÅÏ¢£¬ÏÂÃæÀý×ÓÑÝʾÈçºÎ½«ÍøÉϲ鵽µÄ½á¹ûת»»³ÉJSON¶ÔÏó¡£ Õâ¸öÀý×ÓʹÓÃÁËÒ»¸öµÂ¹úÌú·¹«Ë¾µÄÍøÕ¾

WebServicesÖÐʹÓÃJSON

3 3ÔÂ, 2015  ÔÚ PowershellС¼¼ÇÉ  tagged Web / Web·þÎñ by codecook

ÊÊÓÃÓÚPS3.0¼°ÒÔºó°æ±¾¡£

ÕâÀï¿ÉÒÔÓÃJSON¸ñʽ´ÓÍøÉϵõ½´óÁ¿µÄÐÅÏ¢£¬ÏÂÃæÀý×ÓÑÝʾÈçºÎ½«ÍøÉϲ鵽µÄ½á¹ûת»»³ÉJSON¶ÔÏó¡£

Õâ¸öÀý×ÓʹÓÃÁËÒ»¸öµÂ¹úÌú·¹«Ë¾µÄÍøÕ¾£¬Äã¿ÉÒÔÊäÈëÒ»¸ö»ð³µÕ¾µÄÃû×Ö»ò³ÇÊУ¬Ëû½«·µ»ØÄãÏëҪȥµÄÀàËÆËùÓгµÕ¾Ãû³Æ¡£

# ask for part of the train station name $name = Read-Host 'Enter part of train station Name' # query webservice $url = "http://openbahnapi.appspot.com/rest/stations/list?contains=$name" $site = Invoke-WebRequest -Uri $url # get JSON result ($site.Content | ConvertFrom-Json ).value

Õâ¸ö½á¹ûÀàËÆÈçÏ£º

PS> Enter part of train station name: hanno Hannover Hbf HANNOVER MESSE Hannoversch M¨¹nden Hannover-Nordstadt Hannover Bismarckstr. Hannover Karl-Wiechert-Allee Hannover-Ledeburg Hannover-Linden/Fischerhof Hannover-Vinnhorst Hannover-Leinhausen Hannover Anderten-Misburg Hannover-Bornum PS>

Õâ¸öÀý×Ó²»ÊÇÒª½ÌÄãÈ¥²éѯµÂ¹úÌú·£¬ËùÒÔÈç¹ûÄã¶Ô´Ë²»¸ÐÐËȤ£¬¿ÉÒÔÐ޸ijɱðµÄÓ¦Óãº
Invoke-WebRequestÊÇÒ»¸öÖØÒª²¿·Ö£¬Ëü°üº¬Web·þÎñ·µ»ØµÄ½á¹û£»Í¬Ê±ConvertFrom-Json Ò²Ï൱ÖØÒª£¬Ëü¿ÉÒÔ½«½á¹ûת»¯³É¶ÔÏó¡£
×¢ÒâWeb·þÎñµÄ´¦Àí±ä»¯£¬ÕâÀïÖ»ÊÇÒ»¸öÓÃÀý¡£
Ô­ÎĵØÖ·£º

±¾ÎÄÁ´½Ó£º
Çë×ðÖØÔ­×÷Õߺͱ༭µÄÐÁÇÚÀͶ¯,»¶Ó­×ªÔØ,²¢×¢Ã÷³ö´¦!

Ïà¹ØÎÄÕÂÍƼö£º

¹ØÓÚ codecook

¼ÓÓÍ¡£

²Î¿´ËùÓÐÎÄÕ codecook

Leave a comment

ÎÄÕµ¼º½
  • °ÑÅú´¦Àí·Ïµô°É£¬ÏòPowerShell½ø¾ü
  • ÔÚVisual Studio 2013ÖйÜÀíÖйúÌØÉ«µÄÉç»áÖ÷ÒåWindows Azure

    ¡¡

    1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

    Ïà¹ØÎÄÕÂ
    • php CI ʵս½Ì³Ì£º[5]ÓÃcurl»ñÈ¡json²¢½âÎö

      php CI ʵս½Ì³Ì£º[5]ÓÃcurl»ñÈ¡json²¢½âÎö

      2016-02-26 17:00

    •  JSONÈëÃż¶Ñ§Ï°×ܽá-JSONÊý¾Ý½á¹¹

      JSONÈëÃż¶Ñ§Ï°×ܽá-JSONÊý¾Ý½á¹¹

      2016-02-25 11:05

    • Android½âÎöJsonËÙ¶È×î¿ìµÄ¿â:json

      Android½âÎöJsonËÙ¶È×î¿ìµÄ¿â:json

      2016-02-13 18:00

    • dz̸ʹÓÃPHP¿ª·¢Î¢ÐÅÖ§¸¶µÄÁ÷³Ì

      dz̸ʹÓÃPHP¿ª·¢Î¢ÐÅÖ§¸¶µÄÁ÷³Ì

      2016-02-13 15:00

    ÍøÓѵãÆÀ
    Â