fn build_headers(header_map: &HashMap<String, String>) -> Result<HeaderMap, RoverClientError> {
    let mut headers = HeaderMap::new();

    // this should be consistent for any graphql requests
    let content_type = HeaderValue::from_str(JSON_CONTENT_TYPE)?;
    headers.append("Content-Type", content_type);

    for (key, value) in header_map {
        let header_key = HeaderName::from_bytes(key.as_bytes())?;
        let header_value = HeaderValue::from_str(&value)?;
        headers.append(header_key, header_value);
    }

    Ok(headers)
}
/// Function for building a [HeaderMap] for making http requests. Use for
/// Generic requests to any graphql endpoint.
///
/// Takes a single argument, list of header key/value pairs
Function for building a [HeaderMap] for making http requests. Use for
Generic requests to any graphql endpoint.

Takes a single argument, list of header key/value pairs
Function for building a [ HeaderMap ] for making http requests . Use for Generic requests to any graphql endpoint . Takes a single argument list of header key / value pairs
fn build_headers(header_map: &HashMap<String, String>) -> Result<HeaderMap, RoverClientError> {
    let mut headers = HeaderMap::new();
    // this should be consistent for any graphql requests
    let content_type = HeaderValue::from_str(JSON_CONTENT_TYPE)?;
    headers.append("Content-Type", content_type);
    for (key, value) in header_map {
        let header_key = HeaderName::from_bytes(key.as_bytes())?;
        let header_value = HeaderValue::from_str(&value)?;
        headers.append(header_key, header_value);
    }
    Ok(headers)
}
fn build_headers ( header_map : & HashMap < String , String > ) -> Result < HeaderMap , RoverClientError > { let mut headers = HeaderMap :: new ( ) ; // this should be consistent for any graphql requests let content_type = HeaderValue :: from_str ( JSON_CONTENT_TYPE ) ? ; headers . append ( " " , content_type ) ; for ( key , value ) in header_map { let header_key = HeaderName :: from_bytes ( key . as_bytes ( ) ) ? ; let header_value = HeaderValue :: from_str ( & value ) ? ; headers . append ( header_key , header_value ) ; } Ok ( headers ) }
Function for building a [HeaderMap] for making http requests.
Function for building a [ HeaderMap ] for making http requests .
header_map
&HashMap<String, String>