2015년 1월 3일 토요일

StockQuote Tutorial: Always returns response code 200

I've done the StockQuote tutorial and the response code from the url request always returns 200. So, I tried the .apk provided at the bottom of the tutorial. It also has a constant return code of 200. Any suggestions, explanations, etc.?




The code 200 means that the request is being fulfilled. That means your web call is successful! 

If you want to see what the stock price is, take a look at the tutorial under the Receiving the Data heading. There are some blocks that show you what you'll need to do to process the web request to see the stock price.

I'm not sure why the tutorial .apk has a return code of 200, but doesn't show the price. I'll take a look. It could be that it is unfinished.

Let us know if you have any more questions.

Good luck and happy apping!



I downloaded the app via the QR code, and it works correctly.



This was a misunderstanding on my part of what the return code means. I thought that if an invalid stock code was entered that the return code would be other than 200. I understand now -- the url successfully fulfills the request even if one enters "invalid" data. This means that both my code and the tutorial .apk are not in error. Thanks for the info.



Okay, I'm glad we could figure it out. You could add some blocks to handle the case where the request returns 200 but does not have information due to invalid stock symbol.


댓글 없음:

댓글 쓰기