Jump to content




http.request problems

api lua networking

3 replies to this topic

#1 DannySMc

  • Members
  • 1,808 posts
  • Location/home/dannysmc95

Posted 20 May 2015 - 04:01 PM

I do not understand why this does not output anything? it just comes back as nil? but when I use http.post() it comes back?

I have tested this via the post and it DOES work, try it and do readAll() and it will show you.. but for some reason http.request just comes back with nil? everytime?

Someone help :/

CODE:
Spoiler


#2 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 20 May 2015 - 04:03 PM

I think that it will queue an event, making asynchronous

Actually I am pretty sure

#3 DannySMc

  • Members
  • 1,808 posts
  • Location/home/dannysmc95

Posted 20 May 2015 - 04:29 PM

View PostCreator, on 20 May 2015 - 04:03 PM, said:

I think that it will queue an event, making asynchronous

Actually I am pretty sure

So how do I get it back? Like how do I actually make it async? Any possible amends of the code for me?:D

#4 Lignum

  • Members
  • 558 posts

Posted 20 May 2015 - 04:37 PM

Take a look at this wiki page, it shows that http.request doesn't actually give anything back, which is why it's nil. It queues a http_success event with the http handle as the second parameter. If the request failed, http_failure is queued.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users