-
Notifications
You must be signed in to change notification settings - Fork 4
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
http client url project description #28
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Хороший проект, но не хватает структурированности по заданиям. Нужно четко разделить каждое задание по отдельному функционалу.
http-curl/README.md
Outdated
curl is a simple yet powerful tool for communicating with servers. Here are some common applications: | ||
* Fetching Web Pages: You can easily retrieve web pages by running a command like curl https://example.com, which will display the HTML content directly in your terminal. | ||
* Testing APIs: curl is frequently used to send requests to RESTful APIs. For instance, to fetch user information, you might use curl -X GET https://api.example.com/users/1. | ||
* Uploading Files: You can upload files to a server using the POST method. For example: curl -X POST -F "file=@/path/to/file" https://upload.example.com. | ||
* Debugging: You can check server responses and headers with commands like curl -I https://example.com, which retrieves only the HTTP headers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Примеры вызова curl обернуть между backtick символами, например curl https://example.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
исправил
http-curl/README.md
Outdated
When implementing the project, consider handling options similarly to how curl does. You can find more information about options [here](https://everything.curl.dev/cmdline/options/index.html). | ||
|
||
Additionally, you should map errors to the appropriate exit codes. More details on exit codes can be found [here](https://everything.curl.dev/cmdline/options/index.html). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ссылка на error codes ведут на options. Возможно ошибка
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
исправил ссылку
http-curl/README.md
Outdated
- **Your code MUST be written in accordance with [gofumpt](https://github.com/mvdan/gofumpt). If not, you will be graded `0` automatically. | ||
- **Your program MUST be able to compile successfully.** | ||
- **Your program MUST not exit unexpectedly (any panics: `nil-pointer dereference`, `index out of range` etc.). If so, you will be get `0` during the defence.** | ||
- **Only built-in packages from the Go standard library are allowed, excluding `net/http`.** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Убрать выделение жирным
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
исправил
http-curl/README.md
Outdated
### Using only HTTP | ||
|
||
The program must operate exclusively with the HTTP protocol, without relying on the `net/http` package or external HTTP libraries. Requests should be handled through raw TCP connections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Перенеси этот текст в Usage, так как это не является отдельным заданием
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Исправил
http-curl/README.md
Outdated
### Reading options from a configuration file | ||
|
||
Your program should support reading options from a plain text configuration file. The file could look like: | ||
|
||
``` | ||
method=GET | ||
url=http://example.com | ||
headers=User-Agent: MyClient | ||
``` | ||
|
||
You should be able to run the program like this: | ||
|
||
```bash | ||
./http-url -c config.txt | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нужна ссылка на спецификацию config файла
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Добавил ссылку
http-curl/README.md
Outdated
./http-url -c config.txt | ||
``` | ||
|
||
### Supporting options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Supporting
-> Supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Исправил
http-curl/README.md
Outdated
- **`-d`** or **`data`**: Provide data for a POST request | ||
- **`-F`** or **`--form`** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data
-> --data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Исправил
http-curl/README.md
Outdated
|
||
### Supported HTTP methods | ||
|
||
The program must be able to send two types of requests: GET and POST. The desired method can be specified using the -X option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Стоит подробнее описать, как он будет реагировать допустим на PUT, DELETE. Так как запросы успешно уйдут и отработуют. Вернуть --help message например
The program must be able to send two types of requests: GET and POST. The desired method can be specified using the -X option. | |
The program should only handle GET and POST requests. Other methodsъ should return a `--help` message to guide users on valid request types. The desired method can be specified using the -X option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Видимо я пропустил этот момент при прошлой проверке.
Я думаю что будет лучше если поддерживать произвольный (arbitrary) HTTP метод, так как HTTP протокол позволяет отправлять любую строку
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
добавил
- If no method is specified, GET is the default. | ||
- The program must send a POST request if data is provided with the `-d` or `--data` option | ||
- It must automatically follow up to 5 HTTP redirections (3xx status codes) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Добавить, что соединение обязательно должо быть закрыто, а программа завершена после выполнения.
Здесь про запросы, которые не успеют обработаться, или будут обрабатываться ошибочно, что не завершит выполнение программы
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Надо добавить таймауты, чтобы можно было передавать как аргумент и чтобы был также дефолтный (например 30 сек).
http-curl/README.md
Outdated
In this project, your primary task is to implement several functionalities found in curl. | ||
Your program should be capable of: | ||
* Communicating with servers using the HTTP protocol | ||
* Sending GET requests | ||
* Sending POST requests with additional data | ||
* Handling redirections | ||
* Allowing users to customize headers | ||
* Handling errors | ||
* Reading options from a plain text configuration file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Здесь нужно отразить что нужно уметь отправлять запросы с любым методом
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
добавил
http-curl/README.md
Outdated
|
||
Notes: | ||
|
||
- You are not allowed to use the `net/http` package or external HTTP libraries. All requests must be handled via direct TCP connections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You are not allowed to use the `net/http` package or external HTTP libraries. All requests must be handled via direct TCP connections. | |
- All requests must be handled via direct TCP connections. |
Запрет net/http
уже есть в General Criteria
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
убрал
http-curl/README.md
Outdated
|
||
- You are not allowed to use the `net/http` package or external HTTP libraries. All requests must be handled via direct TCP connections. | ||
- If no method is specified, GET is the default. | ||
- The program must send a POST request if data is provided with the `-d` or `--data` option |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Надо написать что если не указан метод при отправке данных, то используется POST
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
добавил
http-curl/README.md
Outdated
### Details | ||
|
||
The program must display detailed information about the HTTP request and response when `-v` or `--verbose` option specified. This helps in debugging and seeing exactly what’s happening during the HTTP transaction. | ||
|
||
Example: | ||
|
||
```bash | ||
./http-curl -X GET -v http://example.com | ||
``` | ||
|
||
This will output: | ||
|
||
``` | ||
> GET / HTTP/1.1 | ||
> Host: example.com | ||
> User-Agent: your_program/1.0 | ||
> Accept: */* | ||
< HTTP/1.1 200 OK | ||
< Content-Type: text/html | ||
< Content-Length: 1024 | ||
... | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Давай уберем этот пункт. Он слишком сложен, так как есть разные verbosity levels, сложные сообщения при работе с SSL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
убрал
http-curl/README.md
Outdated
|
||
### 1. Plan Before You Code | ||
|
||
Before jumping into writing code, take a step back and plan out what you're going to do. Think about the idea first—code comes second. Having a clear plan makes coding smoother and helps avoid problems later on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before jumping into writing code, take a step back and plan out what you're going to do. Think about the idea first—code comes second. Having a clear plan makes coding smoother and helps avoid problems later on. | |
Before jumping into writing code, take a step back and plan out what you're going to do. Think about the idea first — code comes second. Having a clear plan makes coding smoother and helps avoid problems later on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
исправил
No description provided.