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

Convert line endings on posted text #190

Closed
djedi opened this Issue Jan 27, 2013 · 10 comments

Comments

Projects
None yet
3 participants
@djedi

djedi commented Jan 27, 2013

I'm using OSX and I'm trying to post some text using postman to test an OFX server. Problem is the server expects line endings of \r\n (see http://www.ofxhome.com/ofxforum/viewtopic.php?id=5). I can't seem to figure out how to make this happen.

@a85

This comment has been minimized.

Show comment
Hide comment
@a85

a85 Jan 30, 2013

Wouldn't this be a server side issue? I am not sure if I can change it on the fly but let me see if the editor has some options for line-endings.

a85 commented Jan 30, 2013

Wouldn't this be a server side issue? I am not sure if I can change it on the fly but let me see if the editor has some options for line-endings.

@djedi

This comment has been minimized.

Show comment
Hide comment
@djedi

djedi Jan 30, 2013

I would say its a server side issue, but I have no control over the server I'm trying to post to. It's a very large bank. I'm testing OFX Direct Connect.

djedi commented Jan 30, 2013

I would say its a server side issue, but I have no control over the server I'm trying to post to. It's a very large bank. I'm testing OFX Direct Connect.

@a85

This comment has been minimized.

Show comment
Hide comment
@a85

a85 Feb 2, 2013

Hmm. This sublime text plugin seems to be able to do this: https://github.com/SublimeText/LineEndings. Can you try it out and see if it works?

a85 commented Feb 2, 2013

Hmm. This sublime text plugin seems to be able to do this: https://github.com/SublimeText/LineEndings. Can you try it out and see if it works?

@djedi

This comment has been minimized.

Show comment
Hide comment
@djedi

djedi Feb 4, 2013

I can convert line ending fine in a number of applications, but when I paste into chrome for OSX and submit its changing all line endings to \n.

It would nice if there were an option to say "force to windows line endings (\r\n)", then on submit it would do a regex replace of the line endings with something like raw_data.replace(/\n/g, "\r\n")

djedi commented Feb 4, 2013

I can convert line ending fine in a number of applications, but when I paste into chrome for OSX and submit its changing all line endings to \n.

It would nice if there were an option to say "force to windows line endings (\r\n)", then on submit it would do a regex replace of the line endings with something like raw_data.replace(/\n/g, "\r\n")

@a85

This comment has been minimized.

Show comment
Hide comment
@a85

a85 Feb 5, 2013

Would have to check if that works. Postman sends the request using XMLHttpRequest so if the conversion is happening there then I don't think I would be able to fix it. Ideally it should just send whatever is there in the raw body.

a85 commented Feb 5, 2013

Would have to check if that works. Postman sends the request using XMLHttpRequest so if the conversion is happening there then I don't think I would be able to fix it. Ideally it should just send whatever is there in the raw body.

@djedi

This comment has been minimized.

Show comment
Hide comment
@djedi

djedi Feb 5, 2013

I've forked the repo. Can you tell me where exactly the request is being sent. I can modify it and see if it works. Thanks.

djedi commented Feb 5, 2013

I've forked the repo. Can you tell me where exactly the request is being sent. I can modify it and see if it works. Thanks.

@a85

This comment has been minimized.

Show comment
Hide comment

a85 commented Feb 5, 2013

@djedi

This comment has been minimized.

Show comment
Hide comment
@djedi

djedi Feb 5, 2013

I added these two lines and it solved my problems. https://github.com/djedi/POSTMan-Chrome-Extension/compare/line-endings

I'll see if I can figure out the code enough to add it as an option when submitting.

Thanks for your help!

djedi commented Feb 5, 2013

I added these two lines and it solved my problems. https://github.com/djedi/POSTMan-Chrome-Extension/compare/line-endings

I'll see if I can figure out the code enough to add it as an option when submitting.

Thanks for your help!

@a85

This comment has been minimized.

Show comment
Hide comment
@a85

a85 Feb 5, 2013

Awesome. :)

a85 commented Feb 5, 2013

Awesome. :)

a85 added a commit that referenced this issue May 8, 2013

@a85 a85 closed this May 8, 2013

@PredatorVI

This comment has been minimized.

Show comment
Hide comment
@PredatorVI

PredatorVI Dec 5, 2013

I don't think this is working in the latest POSTMan package. I've removed and reinstalled the latest browser app as well as the Packaged App as of 12/5/2013. When using the Packaged App, I have verified that the "Force WIndows line endings?" setting is set to true, but the Carriage Return 0x0d is still missing. Here is a snippet from the wireshark hex dump. There should be a '0d 0a' after 'index', but there is only a '0a'

 000001D0  2f 38 30 2f 69 6e 64 65  78 2e 68 74 6d 6c 0a 30 /80/inde x.html.0

The HexDump from Fiddler shows the 0d0a:

 ![image](https://f.cloud.github.com/assets/1933277/1688253/d9b00408-5e03-11e3-9f4d-ac151690ca35.png)

PredatorVI commented Dec 5, 2013

I don't think this is working in the latest POSTMan package. I've removed and reinstalled the latest browser app as well as the Packaged App as of 12/5/2013. When using the Packaged App, I have verified that the "Force WIndows line endings?" setting is set to true, but the Carriage Return 0x0d is still missing. Here is a snippet from the wireshark hex dump. There should be a '0d 0a' after 'index', but there is only a '0a'

 000001D0  2f 38 30 2f 69 6e 64 65  78 2e 68 74 6d 6c 0a 30 /80/inde x.html.0

The HexDump from Fiddler shows the 0d0a:

 ![image](https://f.cloud.github.com/assets/1933277/1688253/d9b00408-5e03-11e3-9f4d-ac151690ca35.png)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment