Skip to content

Line ending support and content length addition #244

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

Closed
ArnoldBraine opened this issue Apr 29, 2020 · 2 comments · Fixed by #265, postmanlabs/postman-app-support#9206 or postmanlabs/postman-app-support#9222

Comments

@ArnoldBraine
Copy link

Is your feature request related to a problem? Please describe.
I was coding a program in C using the winsock library, this requires met to create a message string in which the HTTP code gen helped me loads but it starts to become a problem when you need to escape the \r and \n. Also the generated code that the HTTP code generate suggested didn't work because of the content length not being there

Describe the solution you'd like
add an option to see line endings and add the content-length

Additional context
"POST / HTTP/1.1\r\nHost: 127.0.0.1\r\nContent-Type: application/json; charset=utf-8\r\nContent-Length: 10\r\n\r\n{"test":1}\r\n

@ArnoldBraine ArnoldBraine changed the title Line ending support and content lenght addition Line ending support and content length addition Apr 29, 2020
@someshkoli
Copy link
Contributor

someshkoli commented May 17, 2020

@ArnoldBraine I understood what you were trying to say but can you give one more example with different content type ( maybe xml ) ? would be helpful to create a patch for this.

@ArnoldBraine
Copy link
Author

ArnoldBraine commented May 28, 2020

@someshkoli here is an example of the generated HTTP code using xml als content
POST /upload HTTP/1.1 Host: localhost:3000 Content-Type: application/xml <note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend!</body></note>

what it should be:

POST /upload HTTP/1.1 Host: localhost:3000 Content-Type: application/xml Content-Length:112 <note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend!</body></note>

The line endings are required for that library i think, it would maybe be nice to have it as an option so you can turn it on or off as a user

So in the end with line endings enabled and content length added to the code you would have something in the lines of that would be easy to copy and paste:
POST /upload HTTP/1.1\r\nHost: localhost:3000\r\nContent-Type: application/xml\r\nContent-Length:112\r\n\r\n<note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend!</body></note>

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