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

Feature/strest #105

Merged
merged 4 commits into from Nov 6, 2018
Merged

Feature/strest #105

merged 4 commits into from Nov 6, 2018

Conversation

jgroom33
Copy link
Collaborator

@jgroom33 jgroom33 commented Nov 2, 2018

No description provided.

@NickCarneiro NickCarneiro merged commit 6bf8791 into curlconverter:master Nov 6, 2018
@NickCarneiro
Copy link
Member

NickCarneiro commented Nov 6, 2018

@jgroom33 Could you add support for non-json data types in Strest?

On the demo site, non-json data will cause this block to fail. (Click the "POST" link)

if (request.data) {
    response.requests.curl_converter.data = {
      'json': JSON.parse(request.data)
    }
  }

It looks like strest supports regular key-value style data. Here is an example from their repo.

version: 1

requests:
  userRequest:
    url: https://postman-echo.com/get
    method: GET
    data:
      params:
        name: Fake(name.firstName) Fake(name.lastName)
    log: true

example input used by the demo site:

curl 'http://fiddle.jshell.net/echo/html/' -H 'Origin: http://fiddle.jshell.net' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: */*' -H 'Referer: http://fiddle.jshell.net/_display/' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' --data 'msg1=wow&msg2=such' --compressed

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

Successfully merging this pull request may close these issues.

None yet

2 participants