# PetscHTTPRequest
Send a request to an HTTP server 
## Synopsis
```
PetscErrorCode PetscHTTPRequest(const char type[], const char url[], const char header[], const char ctype[], const char body[], int sock, char buff[], size_t buffsize)
```

## Input Parameters

- ***type -*** either "POST" or "GET"
- ***url -*** URL of request host/path
- ***header -*** additional header information, may be NULL
- ***ctype -*** data type of body, for example application/json
- ***body -*** data to send to server
- ***sock -*** obtained with `PetscOpenSocket()`
- ***buffsize -*** size of buffer



## Output Parameter

- ***buff -*** everything returned from server





## See Also
 `PetscHTTPSRequest()`, `PetscOpenSocket()`, `PetscHTTPSConnect()`, `PetscPullJSONValue()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/webclient/client.c.html#PetscHTTPRequest">src/sys/webclient/client.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/webclient/client.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
