Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with some websites? #4

Closed
mcseemk opened this issue Mar 10, 2019 · 2 comments
Closed

Doesn't work with some websites? #4

mcseemk opened this issue Mar 10, 2019 · 2 comments

Comments

@mcseemk
Copy link

mcseemk commented Mar 10, 2019

Hi! Seems like ureq is not compatible with some websites. Any idea why?
Here is an example:

let resp = ureq::get("https://www.okex.com/api/spot/v3/products")
    .set("Connection", "keep-alive")
    .set("Accept-Encoding", "identity")
    .timeout_connect(5_000)
    .timeout_read(5_000)
    .timeout_write(5_000)
    .call();
if !resp.ok() {
    eprintln!("Error! Code {}, line {}", resp.status(), resp.status_line());
}

It prints: Error! Code 500, line HTTP/1.1 500 Bad Status

Same URL works fine via firefox/chrome/curl/hyper/mio_httpc.

Same thing happens for URL https://api.fcoin.com/v2/public/symbols

@lolgesten
Copy link
Contributor

Thanks! I'll look into it!

@algesten
Copy link
Owner

This was because these sites don't return a status text which the lib expected. Fixed in 0.9.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants