broadfield-dev commited on
Commit
7cb6dab
·
verified ·
1 Parent(s): eb771ed

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -1
README.md CHANGED
@@ -9,4 +9,15 @@ app_file: app.py
9
  pinned: false
10
  ---
11
 
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
9
  pinned: false
10
  ---
11
 
12
+
13
+ **1. Receive as a Python Dictionary (JSON Object)**
14
+ Useful if you want to immediately work with the data in Python.
15
+ ```python
16
+ import requests; data = requests.post("http://localhost:7860/api/process", json={"code": "def hello(): pass", "format": "json"}, headers={"Authorization": "Bearer hf_YOUR_TOKEN"}).json()
17
+ ```
18
+
19
+ **2. Receive as a JSONL String**
20
+ Useful if you are appending directly to a file or stream.
21
+ ```python
22
+ import requests; jsonl_string = requests.post("http://localhost:7860/api/process", json={"code": "def hello(): pass", "format": "jsonl"}, headers={"Authorization": "Bearer hf_YOUR_TOKEN"}).text
23
+ ```