Coder Social home page Coder Social logo

Question about fetchUrl about cyber HOT 4 CLOSED

fubark avatar fubark commented on September 24, 2024
Question about fetchUrl

from cyber.

Comments (4)

GabCores avatar GabCores commented on September 24, 2024 1

now working fine!

from cyber.

fubark avatar fubark commented on September 24, 2024

fetchUrl is currently synchronous. If you're getting no response, then it's probably a bug with the builtin http client; you should post what url you're using if that's the case. You can also use os.execCmd if you have an installed http client like curl.

There will be an equivalent of await in the language, although the design hasn't been finalized. I don't think there would be a builtin async io library though. Instead, Cyber would provide the ability to create one by exposing an api for Promises.

from cyber.

GabCores avatar GabCores commented on September 24, 2024

pls , try this sample

while true:
resp = fetchUrl('http://httpstat.us/200?sleep=10000')
print resp

no delay of 10s between calls
what is wrong with this expectations ?

by the way , thanks for fixing sleep on Windows!

from cyber.

fubark avatar fubark commented on September 24, 2024

No problem!

This looks like the query parameter isn't sent. So it's actually doing this: GET /200 HTTP/1.1 instead of this GET /200?sleep=10000 HTTP/1.1 That's why you're getting a response so quickly. I'll make the fix now, one moment...

Edit: This should be working now

from cyber.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.