Skip to content

Instantly share code, notes, and snippets.

@preetamtt
Created October 19, 2016 19:14
Show Gist options
  • Save preetamtt/3ad500d46550817a525a0d19621443d6 to your computer and use it in GitHub Desktop.
Save preetamtt/3ad500d46550817a525a0d19621443d6 to your computer and use it in GitHub Desktop.
Duration based price:
curl -v -X POST --data-binary @pb_dur "http://localhost:3000/get-price"
> POST /get-price HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Length: 3729
> Content-Type: application/x-www-form-urlencoded
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
< HTTP/1.1 200 OK
< Date: Wed, 19 Oct 2016 19:09:57 GMT
< Content-Length: 74
< Content-Type: text/plain; charset=utf-8
<
{"base_price":14,"base_price_instant":14,"base_price_customer_contact":14}
Duration not present in the request:
curl -v -X POST --data-binary @post_body "http://localhost:3000/get-price"
> POST /get-price HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Length: 3664
> Content-Type: application/x-www-form-urlencoded
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
< HTTP/1.1 200 OK
< Date: Wed, 19 Oct 2016 19:10:33 GMT
< Content-Length: 71
< Content-Type: text/plain; charset=utf-8
{"base_price":2,"base_price_instant":7,"base_price_customer_contact":7}
Get-price 400:
curl -v -X POST --data "{}" localhost:3000/get-price
* Trying ::1...
* Connected to localhost (::1) port 3000 (#0)
> POST /get-price HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Length: 2
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 2 out of 2 bytes
< HTTP/1.1 400 Bad Request
< Content-Type: text/plain; charset=utf-8
< X-Content-Type-Options: nosniff
< Date: Wed, 19 Oct 2016 19:13:39 GMT
< Content-Length: 56
<
{"error_code":400,"message":"Invalid request received"}
Get-price 500:
curl -v -X POST --data-binary @500_request localhost:3000/get-price
* Trying ::1...
* Connected to localhost (::1) port 3000 (#0)
> POST /get-price HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Length: 144
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 144 out of 144 bytes
< HTTP/1.1 500 Internal Server Error
< Content-Type: text/plain; charset=utf-8
< X-Content-Type-Options: nosniff
< Date: Wed, 19 Oct 2016 19:13:26 GMT
< Content-Length: 64
<
{"error_code":500,"message":"Failed to determine credit price"}
Match end-point:
curl -v -X POST --data-binary @post_body "http://localhost:3000/match"
* Trying ::1...
* Connected to localhost (::1) port 3000 (#0)
> POST /match HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Length: 3664
> Content-Type: application/x-www-form-urlencoded
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
< HTTP/1.1 200 OK
< Date: Wed, 19 Oct 2016 19:13:07 GMT
< Content-Length: 0
< Content-Type: text/plain; charset=utf-8
<
* Connection #0 to host localhost left intact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment