Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
greenback
Posts: 490
Registered: ‎10-17-2010

Re: Method for making an HTTP style request in Cascades/QML?

Selom,

 

THANK YOUYour code sample is very helpful. It is the first time I have seen how to tie together the data source(from a web service) and other elements like iteration, etc.

This will get me started in the right direction. 

Please use plain text.
Developer
donturner
Posts: 135
Registered: ‎11-14-2010
My Carrier: Vodafone

Re: Method for making an HTTP style request in Cascades/QML?

[ Edited ]

Just wanted to say thanks for posting that source code. Really helped me a lot. 

 

For anyone else who is copying the source into momentics, watch out when copying the code, the twitter query URI will be truncated so get the full url by right clicking on the link and opening it in a new window.

 

Or just get it here (sorry I can't figure out how to NOT make it a link): 

 

http://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_n...

 

 

Please use plain text.
Developer
navikun
Posts: 43
Registered: ‎11-19-2010
My Carrier: Verizon

Re: Method for making an HTTP style request in Cascades/QML?

I just wanted to say Thanks to Selom as well. I needed an example like this :Clap:

Please use plain text.
Developer
steve_web
Posts: 318
Registered: ‎05-07-2009
My Carrier: Telus

Re: Method for making an HTTP style request in Cascades/QML?

yeah the last parameter gets truncated it should be "&screen_name=" so that the next line appends the user handle

PlayBook Apps: DataMine, Dots + Boxes, 5 Marbles
BlackBerry SmartPhone Apps: 5 Marbles Soon: **** (D.Z.A), ****Quest, **** Challenge, VaultCracker, DevBrowser, Radial****
Please use plain text.
Trusted Contributor
AllSystemGo
Posts: 140
Registered: ‎11-23-2010
My Carrier: Rogers

Re: Method for making an HTTP style request in Cascades/QML?

[ Edited ]

Thank you Selom for that nice and thoughful example has it helped me understand a little bit more and helpme a bit more in finishing up my app.

 

Thank you for the help again.

Please use plain text.
Developer
bcs925
Posts: 259
Registered: ‎07-13-2012
My Carrier: T-Mobile

Re: Method for making an HTTP style request in Cascades/QML?

Selom (or anyone) by chance can you update the sample code in the post marked as a solution so it works in Beta2?  I get build errors in the app.cpp file and looking at the Upgrade to beta 2 I dont see what needs to be changed to make it work :Helpsmilie:

---
Check out my BB10 Cascades Coding site: BBcascades.com & Cascades Blog: bbcascadescode.tumblr.com

My Built for BlackBerry app: The Dive Plan
Please use plain text.
Trusted Contributor
AllSystemGo
Posts: 140
Registered: ‎11-23-2010
My Carrier: Rogers

Re: Method for making an HTTP style request in Cascades/QML?

Pretty sure all you have to add is the

 

LIBS += -lbbdata


In the .pro file


Worked for me

Please use plain text.
Developer
bcs925
Posts: 259
Registered: ‎07-13-2012
My Carrier: T-Mobile

Re: Method for making an HTTP style request in Cascades/QML?

Yep that worked. Thanks.

---
Check out my BB10 Cascades Coding site: BBcascades.com & Cascades Blog: bbcascadescode.tumblr.com

My Built for BlackBerry app: The Dive Plan
Please use plain text.
Developer
Zukka
Posts: 199
Registered: ‎05-08-2012
My Carrier: Vodafone

Re: Method for making an HTTP style request in Cascades/QML?

when I run App .. return this error:

 

"Error: Host requires authentication status:401"

Error retrieving twitter fee: "Error: Host requires authentication status:401"

_______________________________________________

If U like my post click on LIKE :smileywink:
Please use plain text.
Developer
markwilcox
Posts: 51
Registered: ‎11-23-2012
My Carrier: GiffGaff

Re: Method for making an HTTP style request in Cascades/QML?

Just adding to this thread that you can also do this in QML - you don't have to mix with C++ just to do simple Ajax style requests.

 

I got it working and posted some code here:

http://supportforums.blackberry.com/t5/Cascades-Development/You-CAN-use-XMLHttpRequest-from-QML-in-C...

Please use plain text.