summaryrefslogtreecommitdiff
path: root/topics/testing/using-curl.gmi
blob: 8738d43be806236a4e6b78a5a973956444fa0300 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Using curl

Curl is a command line tool that can be used for testing. We use it extensively for 'sheepdog' monitoring. See

=> ../systems/gn-services.gmi

## GET fetch

A simple fetch may look like

```
URL=https://ci.genenetwork.org/channels.scm
sheepdog_run.rb -c "curl --max-time 20 $URL|grep -i bioinformatics" --tag $URL $*
```

and with GET parameters

```
URL="$host/search?species=mouse&group=BXD&type=Hippocampus+mRNA&dataset=HC_M2_0606_P&search_terms_or=sh*&search_terms_and=&FormID=searchResult"
FIND="2310010I16Rik"
sheepdog_run.rb -c "curl \"$URL\"|grep -i $FIND" --tag "wild-card-search-$URL" $*
```

## POST fetch

Post fetches are a bit harder. First use firefox console and click of Debugger tab. Next click on the POST field in the tabel (you may need to reload the page and cancel any redirections). At the bottom you'll find 'Request payload'. Copy that using a right click and save it in a file named post.in. Next run POST with something like

```
cat data/post-hk.in |curl --max-time 60 -d @- https://genenetwork.org/run_mapping |grep 'Mapping Results'
```