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

Skips -u flag #1

Open
sgbasaraner opened this issue Jan 24, 2022 · 1 comment
Open

Skips -u flag #1

sgbasaraner opened this issue Jan 24, 2022 · 1 comment

Comments

@sgbasaraner
Copy link

Input:
curl -u xxxxxxxxx: -H "Accept-Version: 3" "https://example.com"

Output:

// Generated by curl-to-java: https://fivesmallq.github.io/curl-to-java

Request request = Request.Get("https://example.com");
HttpResponse httpResponse = request.execute().returnResponse();
System.out.println(httpResponse.getStatusLine());
request.setHeader("Accept-Version", "3");
HttpResponse httpResponse = request.execute().returnResponse();
System.out.println(httpResponse.getStatusLine());
if (httpResponse.getEntity() != null) {
	String html = EntityUtils.toString(httpResponse.getEntity());
	System.out.println(html);
}

As can be seen, the script completely skips the -u flag. The same issue isn't present in curl-to-go

@fivesmallq
Copy link
Owner

Confirmed, thanks for the report. I will fix it soon. 👍

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

2 participants